mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-17 06:32:51 +00:00
perf: 优化未读信息数
This commit is contained in:
parent
6448169caa
commit
57567ebb1b
15
resources/assets/js/store/actions.js
vendored
15
resources/assets/js/store/actions.js
vendored
@ -2192,13 +2192,14 @@ export default {
|
|||||||
if (mode === "chat") {
|
if (mode === "chat") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let dialog = state.cacheDialogs.find(({id}) => id == data.dialog_id);
|
if (data.userid !== state.userId) {
|
||||||
// 更新对话列表
|
// 更新对话新增未读数
|
||||||
if (dialog && state.cacheUnreads[data.id] === undefined) {
|
let dialog = state.cacheDialogs.find(({id}) => id == data.dialog_id);
|
||||||
// 新增未读数
|
if (dialog && state.cacheUnreads[data.id] === undefined) {
|
||||||
state.cacheUnreads[data.id] = true;
|
state.cacheUnreads[data.id] = true;
|
||||||
dialog.unread++;
|
dialog.unread++;
|
||||||
dispatch("saveDialog", dialog)
|
dispatch("saveDialog", dialog)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Store.set('dialogMsgPush', data);
|
Store.set('dialogMsgPush', data);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user