close mobile reload

This commit is contained in:
srcrs 2024-04-19 04:27:29 +08:00
parent a9fdd31a4e
commit 3b2fb607a3

View File

@ -180,7 +180,11 @@
}
socket.onclose = event => {
console.log("WebSocket closed. Reconnecting...");
// 使用媒体查询判断设备类型
const isMobile = window.matchMedia('(max-width: 767px)').matches;
if (!isMobile) {
setInterval(reloadHtml, 3000);
}
};
// Send heartbeat message every 120 seconds
const sendHeartbeat = () => {