From 00e37a229d2ef1da43aee0566ed591fba264b258 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:31:16 +0800 Subject: [PATCH] use a more efficient for loop and change CSS paths --- scripts/GUI/windowman.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/scripts/GUI/windowman.js b/scripts/GUI/windowman.js index 6c98cd1..0eed316 100644 --- a/scripts/GUI/windowman.js +++ b/scripts/GUI/windowman.js @@ -19,19 +19,13 @@ export default class windowman { // Prepare the window with its metadata. constructor() { - async function headers() { + function headers() { let LOAD_STATE = true; let UI = { - CSS: [ - chrome.runtime.getURL("/gui/styles/external/fonts/materialdesignicons.min.css"), - chrome.runtime.getURL("/gui/styles/external/materialize/css/materialize.css"), - chrome.runtime.getURL("/gui/styles/ui.css"), - ] + CSS: [chrome.runtime.getURL("/styles/external/fonts/materialdesignicons.min.css"), chrome.runtime.getURL("/styles/external/materialize/css/materialize.css"), chrome.runtime.getURL("/styles/ui.css")] }; - for (let index = 0; index < UI[`CSS`].length; index++) { - const source = UI.CSS[index]; - + (UI[`CSS`]).forEach(async (source) => { try { let resource = false; @@ -57,12 +51,9 @@ export default class windowman { // Stop loading the page when an error has occured; it's not going to work! if (!DEBUG) { window.close(); - } - - // Stop loading immediately during the error. - break; + }; }; - } + }) } // Get the window.