From f4743908b4f0ad59e0b7352b18dcb61530a46494 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Sun, 14 Apr 2024 13:24:53 +0800 Subject: [PATCH] add function to fix updater when update interval is changed --- scripts/fc.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/fc.js b/scripts/fc.js index 10c1332..5b63b31 100644 --- a/scripts/fc.js +++ b/scripts/fc.js @@ -67,12 +67,12 @@ export default class fc { DURATION_PREFERENCES[`duration`] = 24; // Write it. - write([`settings`, `sync`], DURATION_PREFERENCES, -1); + await write([`settings`, `sync`], DURATION_PREFERENCES, -1); }; if (((typeof DURATION_PREFERENCES).includes(`obj`) && DURATION_PREFERENCES != null && !Array.isArray(DURATION_PREFERENCES)) ? ((DURATION_PREFERENCES[`duration`]) ? (DURATION_PREFERENCES[`duration`] > 0) : false) : false) { // Convert DURATION_PREFERENCES[`duration`]) from hrs to milliseconds. - DURATION_PREFERENCES[`duration`] = DURATION_PREFERENCES[`duration`] * 60 * 60 * 1000; + DURATION_PREFERENCES[`duration`] = DURATION_PREFERENCES[`duration`] * (60 ** 2) * 1000; let FILTERS = new filters; // Now, set the interval. @@ -84,9 +84,11 @@ export default class fc { }; // Provide a way to cancel the interval. - let updater_cancel = () => { + let updater_cancel = (updater) => { - } + }; + + }; })