Revert "refactor(LocalStorageObjectProvider): use getItem() and setItem()"

This reverts commit 4f8403adab.
This commit is contained in:
Jesse Mazzella 2024-01-17 15:28:24 -08:00
parent d5b02b0c8c
commit 0de66401cd

View File

@ -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;
}
}