From 649cfe517ea334f79356f6f5e827d0986aeb7f6e Mon Sep 17 00:00:00 2001 From: addison Date: Tue, 16 Nov 2021 10:11:06 -0500 Subject: [PATCH] [bug] Correct getGlobals not pulling from the stored state item --- common/src/services/state.service.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/common/src/services/state.service.ts b/common/src/services/state.service.ts index e29fb448..c21322f5 100644 --- a/common/src/services/state.service.ts +++ b/common/src/services/state.service.ts @@ -1176,13 +1176,10 @@ export class StateService implements StateServiceAbstraction { return globals ?? new GlobalState(); } - private async saveGlobals(globals: GlobalState, options: StorageOptions = { - storageLocation: StorageLocation.Memory, - useSecureStorage: false, - }) { + private async saveGlobals(globals: GlobalState, options: StorageOptions) { return this.useMemory(options.storageLocation) ? this.saveGlobalsToMemory(globals) : - this.saveGlobalsToDisk(globals, options); + await this.saveGlobalsToDisk(globals, options); } private getGlobalsFromMemory(): GlobalState { @@ -1190,7 +1187,7 @@ export class StateService implements StateServiceAbstraction { } private async getGlobalsFromDisk(options: StorageOptions): Promise { - return await this.storageService.get('globals', options); + return (await this.storageService.get('state', options))?.globals; } private saveGlobalsToMemory(globals: GlobalState): void {