add log
This commit is contained in:
parent
220df6ca49
commit
9b312636bc
|
@ -40,7 +40,8 @@
|
|||
|
||||
var matchPreferColorScheme = $window.matchMedia('(prefers-color-scheme: dark)');
|
||||
|
||||
ariaNgLogService.info(matchPreferColorScheme)
|
||||
ariaNgLogService.info('[root.setThemeBySystemSettings] system uses ' + (matchPreferColorScheme.matches ? 'dark' : 'light') + ' theme');
|
||||
|
||||
if (matchPreferColorScheme.matches) {
|
||||
setDarkTheme();
|
||||
} else {
|
||||
|
@ -453,6 +454,8 @@
|
|||
if (ariaNgSettingService.isBrowserSupportMatchMedia()) {
|
||||
var matchPreferColorScheme = $window.matchMedia('(prefers-color-scheme: dark)');
|
||||
matchPreferColorScheme.addEventListener('change', function (e) {
|
||||
ariaNgLogService.info('[root] system switches to ' + (e.matches ? 'dark' : 'light') + ' theme');
|
||||
|
||||
if (ariaNgSettingService.getTheme() === 'system') {
|
||||
if (e.matches) {
|
||||
setDarkTheme();
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
var browserLang = $window.navigator.browserLanguage ? $window.navigator.browserLanguage : $window.navigator.language;
|
||||
|
||||
if (!browserLang) {
|
||||
ariaNgLogService.info('[ariaNgSettingService] cannot get browser language, use default language');
|
||||
return ariaNgDefaultOptions.language;
|
||||
}
|
||||
|
||||
|
@ -113,9 +114,11 @@
|
|||
}
|
||||
|
||||
if (!ariaNgLanguages[browserLang]) {
|
||||
ariaNgLogService.info('[ariaNgSettingService] browser language \"' + browserLang + '\" not support, use default language');
|
||||
return ariaNgDefaultOptions.language;
|
||||
}
|
||||
|
||||
ariaNgLogService.info('[ariaNgSettingService] use browser language \"' + browserLang + '\" as current language');
|
||||
return browserLang;
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue