Fix global vars

This commit is contained in:
redphx
2024-04-24 16:50:59 +07:00
parent 9446e39eb0
commit 9d0f4c380b
30 changed files with 87 additions and 69 deletions

View File

@@ -1,8 +1,9 @@
import { States, AppInterface, SCRIPT_HOME, SCRIPT_VERSION } from "../../utils/global";
import { CE, createButton, Icon, ButtonStyle } from "../../utils/html";
import { getPreferredServerRegion } from "../../utils/region";
import { UserAgent, UserAgentProfile } from "../../utils/user-agent";
import { getPref, Preferences, PrefKey, setPref, toPrefElement } from "../preferences";
import { getLocale, t } from "../translation";
import { t } from "../translation";
const SETTINGS_UI = {
'Better xCloud': {
@@ -159,7 +160,7 @@ export function setupSettingsUi() {
if ((e.target as HTMLElement).id === 'bx_setting_' + PrefKey.BETTER_XCLOUD_LOCALE) {
// Update locale
LOCALE = getLocale();
refreshLocale();
const $btn = $reloadBtnWrapper.firstElementChild! as HTMLButtonElement;
$btn.textContent = t('settings-reloading');
@@ -345,3 +346,6 @@ export function setupSettingsUi() {
const $pageContent = document.getElementById('PageContent');
$pageContent?.parentNode?.insertBefore($container, $pageContent);
}
function refreshLocale() {
throw new Error("Function not implemented.");
}