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(_ => { }).catch(_ => {
this.$store.dispatch("websocketConnection"); this.$store.dispatch("websocketConnection");
}); });
this.$store.dispatch("getBasicData", 5000) this.$store.dispatch("getBasicData", 1000)
} }
} }
} }

View File

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

View File

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