fix: client-server time desync

This commit is contained in:
2026-03-24 16:09:30 +04:00
parent 7f6f79f028
commit 85b078fce3
2 changed files with 21 additions and 2 deletions
+7 -1
View File
@@ -82,7 +82,13 @@ function watchAccount(onPing) {
buf = lines.pop() ?? '';
for (const line of lines) {
if (line.startsWith('data: ')) {
try { onPing(JSON.parse(line.slice(6))); } catch {}
try {
const ping = JSON.parse(line.slice(6));
if (ping.checked_at && new Date(ping.checked_at).getTime() > Date.now()) {
ping.checked_at = new Date().toISOString();
}
onPing(ping);
} catch {}
}
}
}