mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
auto-dark mode for macOS
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: e89f295e1d...0aae22fc00
@@ -15,6 +15,8 @@ import { ElectronRendererSecureStorageService } from 'jslib/electron/services/el
|
|||||||
import { ElectronStorageService } from 'jslib/electron/services/electronStorage.service';
|
import { ElectronStorageService } from 'jslib/electron/services/electronStorage.service';
|
||||||
import { isDev } from 'jslib/electron/utils';
|
import { isDev } from 'jslib/electron/utils';
|
||||||
|
|
||||||
|
import { DeviceType } from 'jslib/enums/deviceType';
|
||||||
|
|
||||||
import { I18nService } from '../services/i18n.service';
|
import { I18nService } from '../services/i18n.service';
|
||||||
|
|
||||||
import { AuthGuardService } from 'jslib/angular/services/auth-guard.service';
|
import { AuthGuardService } from 'jslib/angular/services/auth-guard.service';
|
||||||
@@ -140,7 +142,8 @@ export function initFactory(): Function {
|
|||||||
htmlEl.classList.add('locale_' + i18nService.translationLocale);
|
htmlEl.classList.add('locale_' + i18nService.translationLocale);
|
||||||
let theme = await storageService.get<string>(ConstantsService.themeKey);
|
let theme = await storageService.get<string>(ConstantsService.themeKey);
|
||||||
if (theme == null) {
|
if (theme == null) {
|
||||||
theme = 'light';
|
theme = platformUtilsService.getDevice() === DeviceType.MacOsDesktop &&
|
||||||
|
remote.systemPreferences.isDarkMode() ? 'dark' : 'light';
|
||||||
}
|
}
|
||||||
htmlEl.classList.add('theme_' + theme);
|
htmlEl.classList.add('theme_' + theme);
|
||||||
stateService.save(ConstantsService.disableFaviconKey,
|
stateService.save(ConstantsService.disableFaviconKey,
|
||||||
|
|||||||
Reference in New Issue
Block a user