front fix

This commit is contained in:
2026-03-21 13:24:42 +03:00
parent 852f4fb163
commit cbd764f76b
4 changed files with 44 additions and 9 deletions
+2 -2
View File
@@ -14,11 +14,11 @@ export const useChatStore = create<ChatStore>()(
(set) => ({
chats: [],
setChats: (chats) => set({ chats }),
setChats: (chats) => set({ chats: Array.isArray(chats) ? chats : [] }),
updateChat: (chatId, updates) =>
set((state) => ({
chats: state.chats.map(chat =>
chats: (Array.isArray(state.chats) ? state.chats : []).map(chat =>
chat.chat_id === chatId ? { ...chat, ...updates } : chat
)
})),