diff --git a/web/src/hooks/useRealtime.ts b/web/src/hooks/useRealtime.ts index 56fac91..1382ec4 100644 --- a/web/src/hooks/useRealtime.ts +++ b/web/src/hooks/useRealtime.ts @@ -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) => {