From adcdc56a81b7f7514bf0612bcd7a172cfa8a3fc1 Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Sun, 17 Apr 2022 09:53:43 +0700 Subject: [PATCH] Avoid aborted errors --- web/_js/time.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/_js/time.js b/web/_js/time.js index 3666ef31..227f89fc 100644 --- a/web/_js/time.js +++ b/web/_js/time.js @@ -77,7 +77,9 @@ timelineSlider.addEventListener("input", (event) => { updateTimeout = setTimeout(() => { updateTime(parseInt(timelineSlider.value), currentVariation) setTimeout(() => { - updateTime(parseInt(timelineSlider.value), currentVariation) + if (timelineSlider.value != currentPeriod && abortController.signal.aborted) { + updateTime(parseInt(timelineSlider.value), currentVariation) + } }, 50) }, 25) }) @@ -107,7 +109,6 @@ const dispatchTimeUpdateEvent = (period = timelineSlider.value, atlas = atlas) = } async function updateBackground(newPeriod = currentPeriod, newVariation = currentVariation) { - // console.log(newPeriod, newVariation) abortController.abort() abortController = new AbortController() currentUpdateIndex++