Skip to content

Commit 28dcd6c

Browse files
committed
fix(conversation-list): prevent error when setting unread count by checking item index
1 parent ade833f commit 28dcd6c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/src/stores/conversation.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ export const useConversationStore = defineStore('conversation', () => {
209209
const index = conversations.data.findIndex(conv => conv.uuid === uuid)
210210
if (index !== -1) {
211211
setTimeout(() => {
212-
conversations.data[index].unread_message_count = 0
212+
if (conversations.data?.[index]) {
213+
conversations.data[index].unread_message_count = 0
214+
}
213215
}, 3000)
214216
}
215217
}

0 commit comments

Comments
 (0)