From 6a415e8aa602d886fcfc731eacae12c049dcac5c Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Thu, 23 May 2024 16:28:22 +0800 Subject: [PATCH] automatically open API configuration of the OOBE --- src/scripts/pages/hello.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/scripts/pages/hello.js b/src/scripts/pages/hello.js index 3f34531..82f0895 100644 --- a/src/scripts/pages/hello.js +++ b/src/scripts/pages/hello.js @@ -21,10 +21,19 @@ class Page_MiniConfig extends Page { Set the default options. */ #set() { - (!this.window.tabs.OOBE.selected) ? this.window.tabs.open(`OOBE`, `OOBE_Hello`) : false; + global.read([`init`]).then((STATE) => { + if (!STATE) { + this.window.tabs.open(`OOBE`, `OOBE_Hello`); + + // Update the storage to mark that the OOBE page has been viewed. + global.write([`init`], true, 1, {"silent": true}); + } else { + global.read([`settings`,`analysis`,`api`,`key`]).then((STATE) => { + (!STATE) ? this.window.tabs.open(`OOBE`, `OOBE_APISetup`) : false; + }); + }; + }); - // Update the storage to mark that the OOBE page has been viewed. - global.write([`init`], true, 1, {"silent": true}); } /* @@ -89,8 +98,6 @@ class Page_MiniConfig extends Page { Object.keys(ELEMENTS[STEP_NUMBER][`container`]).forEach((PART) => { ELEMENTS[STEP_NUMBER][`container`][PART].classList.add(`card`.concat(([`container`].includes(PART)) ? `` : `-`.concat(PART))); }); - - ELEMENTS[STEP_NUMBER][`container`][`container`].classList.add(`container`); } const set_contents = () => {