From 2987bdbf5c4866662126a95b3d7f9bf49314a970 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Wed, 8 May 2024 23:53:10 +0800 Subject: [PATCH] automatically regenerate when an error has occured --- scripts/external/watch.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/external/watch.js b/scripts/external/watch.js index 56a493f..5b9a41f 100644 --- a/scripts/external/watch.js +++ b/scripts/external/watch.js @@ -7,7 +7,8 @@ import processor from "/scripts/external/processor.js"; import logging from "/scripts/logging.js"; import texts from "/scripts/mapping/read.js"; import {global} from "/scripts/secretariat.js"; -import nested from "/scripts/utils/nested.js" +import nested from "/scripts/utils/nested.js"; +import pointer from "/scripts/data/pointer.js"; export default class watch { static async main() { @@ -33,7 +34,7 @@ export default class watch { (document.readyState == `complete`) ? PROCESSOR.run(options) : document.onreadystatechange = async () => {(document.readyState == `complete`) ? PROCESSOR.run(options) : PROCESSOR.product.status.done = .125;}; } - (await global.read([`settings`, `behavior`, `autoRun`])) ? document.onreadystatechange = async () => {perform();} : false; + (await global.read([`settings`, `behavior`, `autoRun`]) || await pointer.read([`status`, `error`])) ? document.onreadystatechange = async () => {perform(((await pointer.read([`status`, `error`])) ? {"override": true} : null));} : false; // Create a listener for messages indicating re-processing. chrome.runtime.onMessage.addListener(async (message, sender, sendResponse) => {