From 5de59c32ab20c8ef11c82f7e27c8ece46d427e9e Mon Sep 17 00:00:00 2001 From: Robyn MacCallum Date: Mon, 14 Feb 2022 16:32:55 -0500 Subject: [PATCH] Save localData to local storage instead of in memory (#683) --- common/src/services/state.service.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/common/src/services/state.service.ts b/common/src/services/state.service.ts index 934f40a9e10..da7fb97aa2d 100644 --- a/common/src/services/state.service.ts +++ b/common/src/services/state.service.ts @@ -1613,16 +1613,19 @@ export class StateService< } async getLocalData(options?: StorageOptions): Promise { - return (await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions))) - ?.data?.localData; + return ( + await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())) + )?.data?.localData; } - async setLocalData(value: string, options?: StorageOptions): Promise { const account = await this.getAccount( - this.reconcileOptions(options, this.defaultInMemoryOptions) + this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()) ); account.data.localData = value; - await this.saveAccount(account, this.reconcileOptions(options, this.defaultInMemoryOptions)); + await this.saveAccount( + account, + this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()) + ); } async getLocale(options?: StorageOptions): Promise {