Fix chatdoc create issue (#18)
This commit is contained in:
1 parent
4473b5558e
commit
4e53f40a6a
5 files changed
+30
-13
No files matched your search
@@ -32,11 +32,11 @@ export const setConversations = async ({ commit }: any, payload: IChatConversati
|
||||
export const setConversation = async ({ commit, state }: any, payload: IChatConversation): Promise<void> => {
|
||||
log(setConversation, 'set conversation', payload);
|
||||
const conversations = state.conversations;
|
||||
const index = conversations.findIndex((conversation: IChatConversation) => conversation.id === payload.id);
|
||||
const index = conversations?.findIndex((conversation: IChatConversation) => conversation.id === payload.id);
|
||||
if (index > -1) {
|
||||
conversations[index] = payload;
|
||||
} else {
|
||||
conversations.unshift(payload);
|
||||
conversations?.unshift(payload);
|
||||
}
|
||||
commit('setConversations', conversations);
|
||||
log(setConversation, 'set conversation success', conversations);
|
||||
|
||||
Reference in new issue
Block a user