diff --git a/src/abstractions/platformUtils.service.ts b/src/abstractions/platformUtils.service.ts index c717b8962b..918528eaf2 100644 --- a/src/abstractions/platformUtils.service.ts +++ b/src/abstractions/platformUtils.service.ts @@ -34,5 +34,7 @@ export abstract class PlatformUtilsService { readFromClipboard: (options?: any) => Promise; supportsBiometric: () => Promise; authenticateBiometric: () => Promise; + getDefaultSystemTheme: () => 'light' | 'dark'; + onDefaultSystemThemeChange: (callback: ((theme: 'light' | 'dark') => unknown)) => unknown; supportsSecureStorage: () => boolean; } diff --git a/src/cli/services/cliPlatformUtils.service.ts b/src/cli/services/cliPlatformUtils.service.ts index 934ee8a7b0..a182854ddf 100644 --- a/src/cli/services/cliPlatformUtils.service.ts +++ b/src/cli/services/cliPlatformUtils.service.ts @@ -146,6 +146,13 @@ export class CliPlatformUtilsService implements PlatformUtilsService { return Promise.resolve(false); } + getDefaultSystemTheme() { + return 'light' as 'light' | 'dark'; + } + + onDefaultSystemThemeChange() { + } + supportsSecureStorage(): boolean { return false; } diff --git a/src/electron/services/electronPlatformUtils.service.ts b/src/electron/services/electronPlatformUtils.service.ts index f4dfacf980..0ea3f2188a 100644 --- a/src/electron/services/electronPlatformUtils.service.ts +++ b/src/electron/services/electronPlatformUtils.service.ts @@ -3,6 +3,7 @@ import { ipcRenderer, remote, shell, + // nativeTheme, } from 'electron'; import * as fs from 'fs'; @@ -220,6 +221,17 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService { }); } + getDefaultSystemTheme() { + return 'light' as 'light' | 'dark'; + // return nativeTheme.shouldUseDarkColors ? 'dark' : 'light'; + } + + onDefaultSystemThemeChange(callback: ((theme: 'light' | 'dark') => unknown)) { + // nativeTheme.on('updated', () => { + // callback(this.getDefaultSystemTheme()); + // }); + } + supportsSecureStorage(): boolean { return true; }