1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

auto-dark mode for macOS

This commit is contained in:
Kyle Spearrin
2019-07-24 14:48:08 -04:00
parent e915e81fdd
commit 54375acf58
2 changed files with 5 additions and 2 deletions

2
jslib

Submodule jslib updated: e89f295e1d...0aae22fc00

View File

@@ -15,6 +15,8 @@ import { ElectronRendererSecureStorageService } from 'jslib/electron/services/el
import { ElectronStorageService } from 'jslib/electron/services/electronStorage.service';
import { isDev } from 'jslib/electron/utils';
import { DeviceType } from 'jslib/enums/deviceType';
import { I18nService } from '../services/i18n.service';
import { AuthGuardService } from 'jslib/angular/services/auth-guard.service';
@@ -140,7 +142,8 @@ export function initFactory(): Function {
htmlEl.classList.add('locale_' + i18nService.translationLocale);
let theme = await storageService.get<string>(ConstantsService.themeKey);
if (theme == null) {
theme = 'light';
theme = platformUtilsService.getDevice() === DeviceType.MacOsDesktop &&
remote.systemPreferences.isDarkMode() ? 'dark' : 'light';
}
htmlEl.classList.add('theme_' + theme);
stateService.save(ConstantsService.disableFaviconKey,