fix(settings): restore theme toggle on OKX settings page
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user