1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-06 00:03:29 +00:00

Add theme enums and platformUtilsService helper (#497)

* Use enum for themes, add getEffectiveTheme

* Update electron and cli to use theme refactor
This commit is contained in:
Thomas Rittson
2021-09-30 06:37:36 +10:00
committed by GitHub
parent 91b73fa777
commit ce71c0c0bd
5 changed files with 35 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
import * as child_process from 'child_process';
import { DeviceType } from 'jslib-common/enums/deviceType';
import { ThemeType } from 'jslib-common/enums/themeType';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
@@ -135,13 +136,17 @@ export class CliPlatformUtilsService implements PlatformUtilsService {
}
getDefaultSystemTheme() {
return Promise.resolve('light' as 'light' | 'dark');
return Promise.resolve(ThemeType.Light as ThemeType.Light | ThemeType.Dark);
}
onDefaultSystemThemeChange() {
/* noop */
}
getEffectiveTheme() {
return Promise.resolve(ThemeType.Light);
}
supportsSecureStorage(): boolean {
return false;
}