From be2fd137ba275757ea0b2dd3c75fe7d386e7ed65 Mon Sep 17 00:00:00 2001 From: Kevin Riehl Date: Wed, 11 Mar 2026 21:34:48 -0700 Subject: [PATCH] Add emitTyping method to chat store --- src/stores/chat-store.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/stores/chat-store.ts b/src/stores/chat-store.ts index c43b47c..67e0542 100644 --- a/src/stores/chat-store.ts +++ b/src/stores/chat-store.ts @@ -20,6 +20,7 @@ interface ChatState { openConversation: (friendId: string) => Promise; loadMoreMessages: () => Promise; sendMessage: (friendId: string, content: string) => void; + emitTyping: (friendId: string) => void; clearChat: () => void; } @@ -140,6 +141,12 @@ export const useChatStore = create((set, get) => ({ socket.emit('send-message', { recipientId: friendId, content }); }, + emitTyping: (friendId: string) => { + const { socket } = get(); + if (!socket) return; + socket.emit('typing', { recipientId: friendId }); + }, + clearChat: () => { set({ messages: [],