fix(settings): restore theme toggle on OKX settings page

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-07 12:14:46 +08:00
parent 68d8a97db5
commit b29c54f126
7 changed files with 64 additions and 19 deletions
+25
View File
@@ -238,16 +238,37 @@
tabBooted.clear();
}
function syncShellChrome(tab) {
const onSettings = tab === "settings";
document.querySelectorAll(".instance-header-panel, .instance-top-bar").forEach((el) => {
el.hidden = onSettings;
});
}
function initPaneThemeToggle(tab) {
if (tab !== "settings") return;
const pane = tabPanes.get(tab);
if (!pane || !global.InstanceTheme) return;
if (typeof global.InstanceTheme.initToggleUI === "function") {
global.InstanceTheme.initToggleUI(pane);
}
if (typeof global.InstanceTheme.syncToggleUI === "function") {
global.InstanceTheme.syncToggleUI(pane);
}
}
function activateTab(tab, opts) {
const options = opts || {};
const revisit = !!options.revisit;
const firstBoot = !tabBooted.has(tab);
syncShellChrome(tab);
showPane(tab);
setNavActive(tab);
if (!options.skipUrl) syncUrl(tab, !!options.replace);
notifyParentTabSwitch(tab);
if (firstBoot) {
bootPaneScripts(tab);
initPaneThemeToggle(tab);
runPageInit(tab, { revisit: false });
return;
}
@@ -409,7 +430,11 @@
patchApplyListWindow();
patchHardNavigations();
initBootPane();
if (getTab() === "settings") {
initPaneThemeToggle("settings");
}
bindNav();
syncShellChrome(getTab());
runPageInit(getTab());
preloadAllTabs();
try {