From 1e8cae5115c62c27f5e557d9ca269c2b4fcb5793 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:55:35 +0800 Subject: [PATCH] Make sure that the status actually has something in it before displaying the error --- scripts/pages/error.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/pages/error.js b/scripts/pages/error.js index 266de3c..0bad8f9 100644 --- a/scripts/pages/error.js +++ b/scripts/pages/error.js @@ -71,12 +71,10 @@ class Page_Error extends Page { /* Fill in the content of the page. */ - fill () { - this.update(); + async fill () { + await this.update(); - console.log(this); - - (this[`elements`][`error display`] && this[`status`][`error`]) + (this[`elements`][`error display`] && (this[`status`] ? this[`status`][`error`] : false)) ? (Object.keys(this[`elements`][`error display`]).forEach((KEY) => { this[`elements`][`error display`][KEY].innerText = String(this[`status`][`error`][KEY]) })) @@ -111,7 +109,7 @@ class Page_Error extends Page { try { // Send a message to the content script. Tabs.query(null, 0).then((TAB) => { - chrome.tabs.sendMessage(TAB.id, {"refresh": true}); + chrome.tabs.sendMessage(TAB.id, {"refresh": "automatic"}); }); } catch(err) { logging.error(err.name, err.message, err.stack);