mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-02 02:48:13 +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)) {
|
if (dialog && $A.isArray(dialog.position_msgs)) {
|
||||||
const index = dialog.position_msgs.findIndex(({msg_id}) => msg_id == data.id);
|
const index = dialog.position_msgs.findIndex(({msg_id}) => msg_id == data.id);
|
||||||
if (index > -1) {
|
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);
|
dialog.position_msgs.splice(index, 1);
|
||||||
dispatch("saveDialog", dialog)
|
dispatch("saveDialog", dialog)
|
||||||
}
|
}
|
||||||
dispatch("dialogMsgMark", {
|
|
||||||
type: 'read',
|
|
||||||
dialog_id: data.dialog_id,
|
|
||||||
after_msg_id: data.id,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clearTimeout(state.readTimeout);
|
clearTimeout(state.readTimeout);
|
||||||
@ -3098,6 +3094,15 @@ export default {
|
|||||||
})
|
})
|
||||||
}).finally(_ => {
|
}).finally(_ => {
|
||||||
state.readLoadNum++
|
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);
|
}, 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,
|
readLoadNum: 0,
|
||||||
readTimeout: null,
|
readTimeout: null,
|
||||||
readWaitData: {},
|
readWaitData: {},
|
||||||
|
readEndMark: {},
|
||||||
|
|
||||||
// 文件
|
// 文件
|
||||||
fileLists: [],
|
fileLists: [],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user