From c21ddfe08a0733078b871eb64418aeeb63c0cd9f Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Sat, 24 Feb 2024 01:17:25 +0100 Subject: [PATCH] Removing clearTimeout --- src/components/Background.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/Background.vue b/src/components/Background.vue index ba2887b..50bd332 100644 --- a/src/components/Background.vue +++ b/src/components/Background.vue @@ -7,18 +7,16 @@ function jumpVal(val: number) { return Math.random() > 0.5 ? val + (Math.random() - 0.5) / 2 : Math.random() } -let timeout: any function jumpPoints() { for (let i = 0; i < points.value.length; i++) points.value[i] = [jumpVal(points.value[i][0]), jumpVal(points.value[i][1])] - timeout = setTimeout(jumpPoints, 2000 + Math.random() * 1000) + setTimeout(jumpPoints, 2000 + Math.random() * 1000) } onMounted(() => { jumpPoints() }) -onUnmounted(() => clearTimeout(timeout))