realtime: emit and handle chat_deleted for full chat removals
All checks were successful
CI / test (push) Successful in 38s

This commit is contained in:
2026-03-08 19:41:49 +03:00
parent a896568c53
commit 744ded914d
7 changed files with 73 additions and 4 deletions

View File

@@ -140,6 +140,13 @@ export function useRealtime() {
}
}
}
if (event.event === "chat_deleted") {
const chatId = Number(event.payload.chat_id);
if (Number.isFinite(chatId)) {
chatStore.removeChat(chatId);
scheduleReloadChats();
}
}
if (event.event === "pong") {
lastPongAtRef.current = Date.now();
}