瀏覽代碼

Fixed bug in interval for agi_runtime setting ui

Toby Chui 2 周之前
父節點
當前提交
2104839c93
共有 1 個文件被更改,包括 8 次插入3 次删除
  1. 8 3
      src/web/SystemAO/advance/agi_runtime.html

+ 8 - 3
src/web/SystemAO/advance/agi_runtime.html

@@ -312,9 +312,14 @@
             }
 
             function updateCountdownLabel() {
-                document.getElementById("countdownText").textContent =
-                    loc("agi_runtime/auto_refresh", "Auto-refresh in {n}s")
-                        .replace("{n}", countdownSecs);
+                var el = document.getElementById("countdownText");
+                if (!el) {
+                    clearInterval(window._agiRtInterval);
+                    window._agiRtInterval = null;
+                    return;
+                }
+                el.textContent = loc("agi_runtime/auto_refresh", "Auto-refresh in {n}s")
+                    .replace("{n}", countdownSecs);
             }
 
             /* ── Toast ──────────────────────────────────────────────── */