From 537df460985ff3eece8782620d95ea754e72b121 Mon Sep 17 00:00:00 2001 From: addison Date: Tue, 16 Nov 2021 10:06:26 -0500 Subject: [PATCH] [bug] Adjust theme to be a global state item --- common/src/services/state.service.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/common/src/services/state.service.ts b/common/src/services/state.service.ts index 3ca9d9c7..93200fc5 100644 --- a/common/src/services/state.service.ts +++ b/common/src/services/state.service.ts @@ -1096,17 +1096,10 @@ export class StateService implements StateServiceAbstraction { } async getTheme(options?: StorageOptions): Promise { - const accountTheme = (await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())))?.theme; - const globalTheme = (await this.getGlobals(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())))?.theme; - return accountTheme ?? globalTheme; + return (await this.getGlobals(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())))?.theme; } - async setTheme(value: string, options?: StorageOptions): Promise { - const account = await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())); - if (account != null) { - account.theme = value; - await this.saveAccount(account, this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())); - } + async setTheme(value: string, options?: StorageOptions): Promise { const globals = await this.getGlobals(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())); globals.theme = value; await this.saveGlobals(globals, this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()));