open OOBE when set up is incomplete

Update navigation bar
This commit is contained in:
buzz-lightsnack-2007 2024-05-23 16:29:18 +08:00
parent 6c62f67f4c
commit 4309d1ac6b

View file

@ -4,7 +4,6 @@
// Import modules. // Import modules.
import {global, background} from "/scripts/secretariat.js"; import {global, background} from "/scripts/secretariat.js";
import Window from "/scripts/GUI/window.js";
import Page from "/scripts/pages/page.js"; import Page from "/scripts/pages/page.js";
import Loader from "/scripts/GUI/loader.js"; import Loader from "/scripts/GUI/loader.js";
import Tabs from "/scripts/GUI/tabs.js"; import Tabs from "/scripts/GUI/tabs.js";
@ -36,9 +35,9 @@ class Page_Popup extends Page {
if (override || !this[`ref`]) {this[`ref`] = await global.read([`last`])}; if (override || !this[`ref`]) {this[`ref`] = await global.read([`last`])};
// Get all the data to be used here. // Get all the data to be used here.
let DATA = { let DATA = {};
"status": await global.read([`sites`, this[`ref`], `status`], -1) DATA[`status`] = await global.read([`sites`, this[`ref`], `status`], -1);
}; DATA[`init`] = (await global.read([`init`])) && (await global.read([`settings`,`analysis`,`api`,`key`]));
// Update all other data. // Update all other data.
this[`status`] = (DATA[`status`] != null) this[`status`] = (DATA[`status`] != null)
@ -83,8 +82,12 @@ class Page_Popup extends Page {
// Replace the iframe src with the new page. // Replace the iframe src with the new page.
(this.elements[`frame`].src != PAGE) ? this.elements[`frame`].src = PAGE : false; (this.elements[`frame`].src != PAGE) ? this.elements[`frame`].src = PAGE : false;
// The results page has its own container. // The results and OOBE pages has its own container.
this.elements[`container`].classList[(PAGE.includes(`results`)) ? `remove` : `add`](`container`); this.elements[`container`].classList[([`results`, `OOBE`].includes(SELECTION)) ? `remove` : `add`](`container`);
// Set the title bar content.
this[`window`][`navigation bar`][([`OOBE`].includes(SELECTION)) ? `hide` : `show`](`header`, `results`);
this[`window`][`navigation bar`][([`OOBE`].includes(SELECTION)) ? `show` : `hide`](`header`, `OOBE`);
}; };
}); });
} }