Skip to content

Commit

Permalink
fix: 修复消息当前会话已读的逻辑问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Evansy committed Oct 22, 2023
1 parent 348bacd commit 9831b25
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/stores/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ export const useChatStore = defineStore('chat', () => {
if (item) {
item.unreadCount += 1
}
// 如果新消息的 roomId 和 当前显示的 room 的 Id 一致,就更新已读
} else {
// 且当前路由在 聊天 内
if (route?.path && route?.path === '/') {
apis.markMsgRead({ roomId: currentRoomId.value }).send()
}
}

// 如果当前路由不是聊天,就开始计数
Expand Down

0 comments on commit 9831b25

Please sign in to comment.