fix(web): persistent WS connection, auto-refetch on ready, and direct selector binding with scroll fix
This commit is contained in:
@@ -110,6 +110,10 @@ export const useWebSocketStore = create<WebSocketState>((set, get) => ({
|
||||
if (data.type === 'ready') {
|
||||
set({ connected: true });
|
||||
reconnectDelay = 1000;
|
||||
const activeChan = useChannelStore.getState().activeChannelId;
|
||||
if (activeChan) useMessageStore.getState().fetchMessages(activeChan);
|
||||
const activeConv = useConversationStore.getState().activeConversationId;
|
||||
if (activeConv) useConversationStore.getState().fetchMessages(activeConv);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user