fix(panel): resolve duplicate polling timer declaration causing JS execution failure
Release / Build & Release (push) Canceled after 0s
Release / Build & Release (push) Canceled after 0s
This commit is contained in:
@@ -384,21 +384,3 @@ document.addEventListener("visibilitychange", () => {
|
||||
}
|
||||
});
|
||||
loadWebhooks().catch(console.error);
|
||||
|
||||
// 开启 5 秒平滑实时自动轮询
|
||||
let devicePollTimer = null;
|
||||
function startDevicePolling() {
|
||||
if (devicePollTimer) clearInterval(devicePollTimer);
|
||||
devicePollTimer = setInterval(() => {
|
||||
if (!document.hidden) {
|
||||
loadDevices().catch(console.error);
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
startDevicePolling();
|
||||
|
||||
document.addEventListener("visibilitychange", () => {
|
||||
if (!document.hidden) {
|
||||
loadDevices().catch(console.error);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user