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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user