mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-12 08:58:11 +00:00
perf: 优化打开会话
This commit is contained in:
parent
8a4b0c57f9
commit
5bebc8b5ee
13
resources/assets/js/store/actions.js
vendored
13
resources/assets/js/store/actions.js
vendored
@ -2908,7 +2908,7 @@ export default {
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
openDialog({state, dispatch}, dialog_id) {
|
||||
return new Promise(resolve => {
|
||||
return new Promise(async resolve => {
|
||||
let search_msg_id;
|
||||
let dialog_msg_id;
|
||||
if ($A.isJson(dialog_id)) {
|
||||
@ -2917,6 +2917,17 @@ export default {
|
||||
dialog_id = dialog_id.dialog_id;
|
||||
}
|
||||
//
|
||||
if (dialog_id > 0 && state.cacheDialogs.findIndex(item => item.id == dialog_id) === -1) {
|
||||
dispatch("showSpinner", 300)
|
||||
try {
|
||||
await dispatch("getDialogOne", dialog_id)
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
} finally {
|
||||
dispatch("hiddenSpinner")
|
||||
}
|
||||
}
|
||||
//
|
||||
requestAnimationFrame(_ => {
|
||||
state.dialogSearchMsgId = /^\d+$/.test(search_msg_id) ? search_msg_id : 0;
|
||||
state.dialogMsgId = /^\d+$/.test(dialog_msg_id) ? dialog_msg_id : 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user