diff --git a/im-web/src/store/chatStore.js b/im-web/src/store/chatStore.js
index 3922ee4..cda390f 100644
--- a/im-web/src/store/chatStore.js
+++ b/im-web/src/store/chatStore.js
@@ -196,7 +196,7 @@ export default defineStore('chatStore', {
chat.lastSendTime = msgInfo.sendTime;
chat.sendNickName = msgInfo.sendNickName;
// 未读加1
- if (!chat.isDnd && !msgInfo.selfSend && msgInfo.status != MESSAGE_STATUS.READED &&
+ if (!msgInfo.selfSend && msgInfo.status != MESSAGE_STATUS.READED &&
msgInfo.status != MESSAGE_STATUS.RECALL && msgInfo.type != MESSAGE_TYPE.TIP_TEXT) {
chat.unreadCount++;
}
@@ -350,7 +350,6 @@ export default defineStore('chatStore', {
let chat = this.findChat(chatInfo);
if (chat) {
chat.isDnd = isDnd;
- chat.unreadCount = 0;
}
},
refreshChats() {
@@ -370,9 +369,6 @@ export default defineStore('chatStore', {
chat.isDnd = group.isDnd
}
}
- if (chat.isDnd) {
- chat.unreadCount = 0;
- }
})
// 排序
cacheChats.sort((chat1, chat2) => chat2.lastSendTime - chat1.lastSendTime);
diff --git a/im-web/src/view/Home.vue b/im-web/src/view/Home.vue
index 9c5ac77..67b7d5d 100644
--- a/im-web/src/view/Home.vue
+++ b/im-web/src/view/Home.vue
@@ -392,10 +392,6 @@ export default {
location.href = "/";
},
playAudioTip() {
- // 离线消息不播放铃声
- if (this.chatStore.isLoading()) {
- return;
- }
// 防止过于密集播放
if (new Date().getTime() - this.lastPlayAudioTime > 1000) {
this.lastPlayAudioTime = new Date().getTime();
@@ -439,8 +435,8 @@ export default {
unreadCount() {
let unreadCount = 0;
let chats = this.chatStore.chats;
- chats.forEach((chat) => {
- if (!chat.delete) {
+ chats.forEach(chat => {
+ if (!chat.delete && !chat.isDnd) {
unreadCount += chat.unreadCount
}
});