1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

detect dark theme based on system theme (#271)

This commit is contained in:
Kyle Spearrin
2021-02-12 11:04:09 -05:00
committed by GitHub
parent 0951424de7
commit 0b79f112b9

View File

@@ -3,7 +3,6 @@ import {
ipcRenderer,
remote,
shell,
// nativeTheme,
} from 'electron';
import * as fs from 'fs';
@@ -222,14 +221,13 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
}
getDefaultSystemTheme() {
return 'light' as 'light' | 'dark';
// return nativeTheme.shouldUseDarkColors ? 'dark' : 'light';
return remote.nativeTheme.shouldUseDarkColors ? 'dark' : 'light';
}
onDefaultSystemThemeChange(callback: ((theme: 'light' | 'dark') => unknown)) {
// nativeTheme.on('updated', () => {
// callback(this.getDefaultSystemTheme());
// });
remote.nativeTheme.on('updated', () => {
callback(this.getDefaultSystemTheme());
});
}
supportsSecureStorage(): boolean {