1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00

[refactor] Use ThemeType enum instead of string (#642)

This commit is contained in:
Addison Beck
2022-01-28 05:28:36 -05:00
committed by GitHub
parent 6b4ed5fcce
commit ca5b057b43
4 changed files with 11 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ import { StorageService } from "../abstractions/storage.service";
import { HtmlStorageLocation } from "../enums/htmlStorageLocation";
import { KdfType } from "../enums/kdfType";
import { StorageLocation } from "../enums/storageLocation";
import { ThemeType } from "../enums/themeType";
import { UriMatchType } from "../enums/uriMatchType";
import { CipherView } from "../models/view/cipherView";
@@ -1961,13 +1962,13 @@ export class StateService<TAccount extends Account = Account>
);
}
async getTheme(options?: StorageOptions): Promise<string> {
async getTheme(options?: StorageOptions): Promise<ThemeType> {
return (
await this.getGlobals(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()))
)?.theme;
}
async setTheme(value: string, options?: StorageOptions): Promise<void> {
async setTheme(value: ThemeType, options?: StorageOptions): Promise<void> {
const globals = await this.getGlobals(
this.reconcileOptions(options, await this.defaultOnDiskLocalOptions())
);