Pārlūkot izejas kodu

chore: prevent duplicate watchers

jamesread 3 nedēļas atpakaļ
vecāks
revīzija
c586d4fb21
1 mainītis faili ar 9 papildinājumiem un 1 dzēšanām
  1. 9 1
      frontend/resources/vue/Dashboard.vue

+ 9 - 1
frontend/resources/vue/Dashboard.vue

@@ -167,7 +167,15 @@ async function getDashboard() {
 }
 
 function waitForInitAndLoadDashboard() {
-    // Start the loading timer
+    if (loadingTimer) {
+        clearInterval(loadingTimer)
+        loadingTimer = null
+    }
+    if (checkInitInterval) {
+        clearInterval(checkInitInterval)
+        checkInitInterval = null
+    }
+
     loadingTime.value = 0
     loadingTimer = setInterval(() => {
         loadingTime.value++