fix(realtime): resync active chat messages on websocket reconnect

- on ws reconnect, reload chats and active chat history
- reduce status/history drift after transient disconnects
This commit is contained in:
2026-03-08 02:52:26 +03:00
parent 71d0472337
commit 874f9da12c

View File

@@ -62,7 +62,11 @@ export function useRealtime() {
ws.close();
}
}, 15000);
void useChatStore.getState().loadChats();
const store = useChatStore.getState();
void store.loadChats();
if (store.activeChatId) {
void store.loadMessages(store.activeChatId);
}
};
ws.onmessage = (messageEvent) => {