Explorar el Código

chore: prevent duplicate watchers

jamesread hace 2 semanas
padre
commit
c586d4fb21
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. 9 1
      frontend/resources/vue/Dashboard.vue

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

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