From 7a6033ec8cf62e42017480d5cdb693023950bc03 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:23:03 +0800 Subject: [PATCH] make sure to get the 0th URL item --- scripts/product.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/product.js b/scripts/product.js index da27b17..561d808 100644 --- a/scripts/product.js +++ b/scripts/product.js @@ -25,7 +25,7 @@ export default class product { /* Remove uneeded data or formatting from the URL and the data. */ let clean = (URL) => { // Remove the protocol from the URL. - return(URL.replace(/(^\w+:|^)\/\//, ``).split(`?`)); + return((URL.replace(/(^\w+:|^)\/\//, ``).split(`?`))[0]); } // Set this product's details as part of the object's properties. @@ -67,7 +67,7 @@ export default class product { if (!this.#snip) {throw new ReferenceError((new texts(`error_msg_notattached`)).localized)}; // Save the data to the storage. - secretariat.write([`sites`, this.URL, `data`], this.#snip, 1); + await secretariat.write([`sites`, this.URL, `data`], this.#snip, 1); // Write the analysis data to the storage. (this[`analysis`]) ? secretariat.write([`sites`, this.URL, `analysis`], this.analysis, 1): false;