diff options
author | Joas Schilling <coding@schilljs.com> | 2020-02-27 16:07:10 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-03-02 12:47:37 +0100 |
commit | 91e866b33d7eb274c6aaf9aa29c875cf4cc1790e (patch) | |
tree | ffa70dc9713190307cc92ec8aa080a48bd001792 /src/App.vue | |
parent | 4440aa6ab070b42f5cbefbb22d4ad136339375d6 (diff) |
Immediate refresh the conversation on signaling command to do so
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'src/App.vue')
-rw-r--r-- | src/App.vue | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/App.vue b/src/App.vue index 61c78e077..682b43ed4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -155,6 +155,9 @@ export default { }, beforeDestroy() { + if (!getCurrentUser()) { + EventBus.$off('shouldRefreshConversations', this.refreshCurrentConversation) + } document.removeEventListener('visibilitychange', this.changeWindowVisibility) }, @@ -163,6 +166,7 @@ export default { EventBus.$once('joinedConversation', () => { this.fixmeDelayedSetupOfGuestUsers() }) + EventBus.$on('shouldRefreshConversations', this.refreshCurrentConversation) } if (this.$route.name === 'conversation') { @@ -199,7 +203,7 @@ export default { && !this.$store.getters.conversations[this.token]) { if (!params.singleConversation) { console.info('Conversations received, but the current conversation is not in the list, trying to get potential public conversation manually') - this.fetchSingleConversation(this.token) + this.refreshCurrentConversation() } else { console.info('Conversation received, but the current conversation is not in the list. Redirecting to /apps/spreed') this.$router.push('/apps/spreed/not-found') @@ -278,13 +282,17 @@ export default { fixmeDelayedSetupOfGuestUsers() { // FIXME Refresh the data now that the user joined the conversation // The join request returns this data already, but it's lost in the signaling code - this.fetchSingleConversation(this.token) + this.refreshCurrentConversation() window.setInterval(() => { - this.fetchSingleConversation(this.token) + this.refreshCurrentConversation() }, 30000) }, + refreshCurrentConversation() { + this.fetchSingleConversation(this.token) + }, + changeWindowVisibility() { this.$store.dispatch('setWindowVisibility', !document.hidden) if (this.windowIsVisible) { |