From 47399bb583b92738215776089d0b8ebb4190ec72 Mon Sep 17 00:00:00 2001 From: Robyn MacCallum Date: Thu, 10 Feb 2022 13:55:36 -0500 Subject: [PATCH] Move providers to profile and save to disk (#662) * Move providers to profile and save to disk * Move providers back to AccountData --- common/src/services/state.service.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/src/services/state.service.ts b/common/src/services/state.service.ts index 6dc69cf047..a11c1a5c4b 100644 --- a/common/src/services/state.service.ts +++ b/common/src/services/state.service.ts @@ -1846,8 +1846,9 @@ export class StateService< } async getProviders(options?: StorageOptions): Promise<{ [id: string]: ProviderData }> { - return (await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions))) - ?.data?.providers; + return ( + await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskOptions())) + )?.data?.providers; } async setProviders( @@ -1855,10 +1856,13 @@ export class StateService< options?: StorageOptions ): Promise { const account = await this.getAccount( - this.reconcileOptions(options, this.defaultInMemoryOptions) + this.reconcileOptions(options, await this.defaultOnDiskOptions()) ); account.data.providers = value; - await this.saveAccount(account, this.reconcileOptions(options, this.defaultInMemoryOptions)); + await this.saveAccount( + account, + this.reconcileOptions(options, await this.defaultOnDiskOptions()) + ); } async getPublicKey(options?: StorageOptions): Promise {