From 35663a3ed74601544b45e4cf2af22e8a8bf889d7 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Thu, 9 May 2024 11:40:56 +0800 Subject: [PATCH] update the URL record only when it exists --- scripts/pages/results.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/pages/results.js b/scripts/pages/results.js index 28d69c4..a71c5cf 100644 --- a/scripts/pages/results.js +++ b/scripts/pages/results.js @@ -32,14 +32,17 @@ class Page_Results extends Page { */ async update(override = false) { // Set the reference website when overriding or unset. - if (override || !this[`ref`]) {this[`ref`] = await global.read([`last`])}; + if (override || !this[`ref`]) { + let RECORD = await global.read([`last`]); + (RECORD) ? this[`ref`] = RECORD : false; + }; if (this[`ref`]) { // Get all the data. let DATA = { "data": await global.read([`sites`, this[`ref`]]) } - + // Set the data. this[`data`] = (DATA[`data`] && (typeof DATA[`data`]).includes(`obj`)) ? DATA[`data`] : (this[`data`] ? this[`data`] : {}); }