From b61100af0255f716eb431ea021467f2270f9834b Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Wed, 1 May 2024 19:10:11 +0800 Subject: [PATCH] only read data if auto run is enabled --- scripts/external/watch.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/external/watch.js b/scripts/external/watch.js index 04b31cb..c886925 100644 --- a/scripts/external/watch.js +++ b/scripts/external/watch.js @@ -6,7 +6,7 @@ import check from "/scripts/external/check.js"; import processor from "/scripts/external/processor.js"; import logging from "/scripts/logging.js"; import texts from "/scripts/mapping/read.js"; -import {read} from "/scripts/secretariat.js"; +import {global} from "/scripts/secretariat.js"; export default class watch { /* Open relevant graphical user interfaces. @@ -19,13 +19,13 @@ export default class watch { @param {dictionary} filter the filter to work with */ - static process(filter) { + static async process(filter) { // Let user know that the website is supported, if ever they have opened the console. new logging((new texts(`message_external_supported`)).localized); - // Begin only when the page is fully loaded. - document.onreadystatechange = () => { - if (document.readyState == 'complete') { + document.onreadystatechange = async () => { + if (document.readyState == 'complete' && await global.read([`settings`, `behavior`, `autoRun`])) { + console.log(`Loading complete, processing…`); let PROC = new processor(filter); } };