mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-27 21:28:12 +00:00
fix: 消息阅读回馈
This commit is contained in:
parent
e215cda700
commit
4144f92631
15
resources/assets/js/store/actions.js
vendored
15
resources/assets/js/store/actions.js
vendored
@ -3062,14 +3062,10 @@ export default {
|
||||
if (dialog && $A.isArray(dialog.position_msgs)) {
|
||||
const index = dialog.position_msgs.findIndex(({msg_id}) => msg_id == data.id);
|
||||
if (index > -1) {
|
||||
state.readEndMark[data.dialog_id] = Math.max(data.id, $A.runNum(state.readEndMark[data.dialog_id]))
|
||||
dialog.position_msgs.splice(index, 1);
|
||||
dispatch("saveDialog", dialog)
|
||||
}
|
||||
dispatch("dialogMsgMark", {
|
||||
type: 'read',
|
||||
dialog_id: data.dialog_id,
|
||||
after_msg_id: data.id,
|
||||
})
|
||||
}
|
||||
}
|
||||
clearTimeout(state.readTimeout);
|
||||
@ -3098,6 +3094,15 @@ export default {
|
||||
})
|
||||
}).finally(_ => {
|
||||
state.readLoadNum++
|
||||
//
|
||||
for (let dialog_id in state.readEndMark) {
|
||||
dispatch("dialogMsgMark", {
|
||||
type: 'read',
|
||||
dialog_id,
|
||||
after_msg_id: state.readEndMark[dialog_id],
|
||||
})
|
||||
}
|
||||
state.readEndMark = {}
|
||||
});
|
||||
}, 50);
|
||||
},
|
||||
|
||||
1
resources/assets/js/store/state.js
vendored
1
resources/assets/js/store/state.js
vendored
@ -130,6 +130,7 @@ export default {
|
||||
readLoadNum: 0,
|
||||
readTimeout: null,
|
||||
readWaitData: {},
|
||||
readEndMark: {},
|
||||
|
||||
// 文件
|
||||
fileLists: [],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user