From 3224a56b4aa46defd7409dcda057ec87cd69c383 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sat, 9 May 2026 23:07:09 +0200 Subject: [PATCH] fix sync --- modules/web/web.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/web/web.js b/modules/web/web.js index 9fffaed..9b32e34 100644 --- a/modules/web/web.js +++ b/modules/web/web.js @@ -55,8 +55,6 @@ function initLayout() { } } -// ─── WebSocket ─────────────────────────────────────────────────────────────── - function connectWs() { const statusEl = document.getElementById("server-status"); statusEl.textContent = "connecting..."; @@ -88,10 +86,10 @@ function connectWs() { function syncTime() { wsSend({ action: "get_time", client_time: performance.now() / 1000 }); + setInterval(syncTime, 10000); } - setInterval(syncTime, 10000); - syncTime(); // initial sync + setInterval(syncTime, 500); } function wsSend(obj) {