no message

This commit is contained in:
kuaifan 2022-05-22 13:37:56 +08:00
parent 972c01bd67
commit 2e6eb81648
3 changed files with 17 additions and 10 deletions

View File

@ -266,7 +266,7 @@ export default {
}).catch(_ => {
this.$store.dispatch("websocketConnection");
});
this.$store.dispatch("getBasicData", 5000)
this.$store.dispatch("getBasicData", 1000)
}
}
}

View File

@ -679,7 +679,7 @@ export default {
wsOpenNum(num) {
if (num <= 1) return
this.$store.dispatch("getBasicData", 5000).then(this.getReportUnread)
this.$store.dispatch("getBasicData", 1000).then(this.getReportUnread)
},
workReportShow(show) {

View File

@ -160,7 +160,11 @@ export default {
},
activated() {
this.updateDialogs();
this.updateDialogs(1000);
},
deactivated() {
this.updateDialogs(-1);
},
computed: {
@ -285,7 +289,7 @@ export default {
if (val == 'contacts') {
this.contactsData === null && this.getContactsList(1);
} else {
this.updateDialogs();
this.updateDialogs(1000);
}
},
immediate: true
@ -537,13 +541,16 @@ export default {
});
},
updateDialogs() {
updateDialogs(timeout) {
this.__updateDialogs && clearTimeout(this.__updateDialogs)
this.__updateDialogs = setTimeout(_ => {
if (this.tabActive === 'dialog') {
this.$store.dispatch("getDialogs", true).catch(() => {});
}
}, 2000)
if (timeout > -1) {
this.__updateDialogs = setTimeout(_ => {
if (this.tabActive === 'dialog') {
this.$store.dispatch("getDialogs", true).catch(() => {
});
}
}, timeout)
}
},
}
}