Make sure that the status actually has something in it before displaying the error

This commit is contained in:
buzz-lightsnack-2007 2024-05-08 23:55:35 +08:00
parent a113d188fa
commit 1e8cae5115

View file

@ -71,12 +71,10 @@ class Page_Error extends Page {
/* /*
Fill in the content of the page. Fill in the content of the page.
*/ */
fill () { async fill () {
this.update(); await this.update();
console.log(this); (this[`elements`][`error display`] && (this[`status`] ? this[`status`][`error`] : false))
(this[`elements`][`error display`] && this[`status`][`error`])
? (Object.keys(this[`elements`][`error display`]).forEach((KEY) => { ? (Object.keys(this[`elements`][`error display`]).forEach((KEY) => {
this[`elements`][`error display`][KEY].innerText = String(this[`status`][`error`][KEY]) this[`elements`][`error display`][KEY].innerText = String(this[`status`][`error`][KEY])
})) }))
@ -111,7 +109,7 @@ class Page_Error extends Page {
try { try {
// Send a message to the content script. // Send a message to the content script.
Tabs.query(null, 0).then((TAB) => { Tabs.query(null, 0).then((TAB) => {
chrome.tabs.sendMessage(TAB.id, {"refresh": true}); chrome.tabs.sendMessage(TAB.id, {"refresh": "automatic"});
}); });
} catch(err) { } catch(err) {
logging.error(err.name, err.message, err.stack); logging.error(err.name, err.message, err.stack);