diff options
author | Jaz <ericvolp12@gmail.com> | 2023-05-16 21:36:43 -0700 |
---|---|---|
committer | Jaz <ericvolp12@gmail.com> | 2023-05-16 21:36:43 -0700 |
commit | da0ed7e002c926f2a3a342d8d420304b10aa8663 (patch) | |
tree | 56a59e5257b5bf1405d9fd453adf119e9d186830 /src/state/models | |
parent | 404b2f043c2243961cf5b101a0134f2db3610769 (diff) | |
download | voidsky-da0ed7e002c926f2a3a342d8d420304b10aa8663.tar.zst |
Feat: Use system default color mode, but allow user override
Diffstat (limited to 'src/state/models')
-rw-r--r-- | src/state/models/ui/shell.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/state/models/ui/shell.ts b/src/state/models/ui/shell.ts index 9b9a176be..187342ec3 100644 --- a/src/state/models/ui/shell.ts +++ b/src/state/models/ui/shell.ts @@ -189,7 +189,7 @@ export interface ComposerOpts { } export class ShellUiModel { - darkMode = false + colorMode = 'system' minimalShellMode = false isDrawerOpen = false isDrawerSwipeDisabled = false @@ -210,20 +210,20 @@ export class ShellUiModel { serialize(): unknown { return { - darkMode: this.darkMode, + colorMode: this.colorMode, } } hydrate(v: unknown) { if (isObj(v)) { - if (hasProp(v, 'darkMode') && typeof v.darkMode === 'boolean') { - this.darkMode = v.darkMode + if (hasProp(v, 'colorMode') && typeof v.colorMode === 'string') { + this.colorMode = v.colorMode } } } - setDarkMode(v: boolean) { - this.darkMode = v + setColorMode(mode: string) { + this.colorMode = mode } setMinimalShellMode(v: boolean) { |