perf: 优化打开个人会话速度

This commit is contained in:
kuaifan 2022-12-12 09:43:59 +08:00
parent 3416f41116
commit 2189337a1d

View File

@ -2192,6 +2192,16 @@ export default {
*/
openDialogUserid({state, dispatch}, userid) {
return new Promise(function (resolve, reject) {
const dialog = state.cacheDialogs.find(item => {
if (item.type !== 'user' || !item.dialog_user) {
return false
}
return item.dialog_user.userid === userid
});
if (dialog) {
dispatch("openDialog", dialog.id);
return;
}
dispatch("call", {
url: 'dialog/open/user',
data: {