Revert "refactor(LocalStorageObjectProvider): use getItem() and setItem()"
This reverts commit 4f8403adab.
This commit is contained in:
@@ -71,14 +71,14 @@ export default class LocalStorageObjectProvider {
|
||||
* @private
|
||||
*/
|
||||
persistSpace(space) {
|
||||
this.localStorage.setItem(this.spaceKey, JSON.stringify(space));
|
||||
this.localStorage[this.spaceKey] = JSON.stringify(space);
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
getSpace() {
|
||||
return this.localStorage.getItem(this.spaceKey);
|
||||
return this.localStorage[this.spaceKey];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,7 +93,7 @@ export default class LocalStorageObjectProvider {
|
||||
*/
|
||||
initializeSpace() {
|
||||
if (this.isEmpty()) {
|
||||
this.localStorage.setItem(this.spaceKey, JSON.stringify({}));
|
||||
this.localStorage[this.spaceKey] = JSON.stringify({});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,6 @@ export default class LocalStorageObjectProvider {
|
||||
* @private
|
||||
*/
|
||||
isEmpty() {
|
||||
return this.getSpace() === null;
|
||||
return this.getSpace() === undefined;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user