mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 14:23:51 +02:00
Organize bootstrap.js
This commit is contained in:
32
src/plugin/ui.js
Normal file
32
src/plugin/ui.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import configRepository from '../service/config';
|
||||
import {
|
||||
changeAppDarkStyle,
|
||||
changeAppThemeStyle,
|
||||
refreshCustomCss,
|
||||
refreshCustomScript,
|
||||
setLoginContainerStyle,
|
||||
getThemeMode
|
||||
} from '../shared/utils/base/ui';
|
||||
import { i18n } from './i18n';
|
||||
|
||||
export async function initUi() {
|
||||
try {
|
||||
// @ts-ignore
|
||||
i18n.locale = await configRepository.getString(
|
||||
'VRCX_appLanguage',
|
||||
'en'
|
||||
);
|
||||
|
||||
const { initThemeMode, isDarkMode } =
|
||||
await getThemeMode(configRepository);
|
||||
|
||||
setLoginContainerStyle(isDarkMode);
|
||||
changeAppDarkStyle(isDarkMode);
|
||||
changeAppThemeStyle(initThemeMode);
|
||||
} catch (error) {
|
||||
console.error('Error initializing locale and theme:', error);
|
||||
}
|
||||
|
||||
refreshCustomCss();
|
||||
refreshCustomScript();
|
||||
}
|
||||
Reference in New Issue
Block a user