summaryrefslogtreecommitdiffstats
path: root/src/components/LeftSidebar/LeftSidebar.vue
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2023-01-31 04:42:44 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2023-01-31 05:00:56 +0100
commitafde0e0d3a0b21eff34a884901c86047828f943f (patch)
tree81c0e58c4ddae261474e062a94dbd62cc66c7a3a /src/components/LeftSidebar/LeftSidebar.vue
parentc58be9dcab5fff8a63b94de73b3536caec1d5a94 (diff)
Update room properties with data from "roomlist" update event
The external signaling server includes some room data in the "roomlist" update event sent when a room is modified. That data is up to date, and it will be the same received when fetching the room data again, so the properties can be already updated in the store. This prevents the lobby from being briefly shown when switching to a breakout room due to the "switchto" message being handled before the updated room data could be fetched from the server. In order to keep the changes to a minimum note that this does was not applied to guest users, as a different event seems to be sent in that case, nor to the Talk sidebar, as the current properties provided in the event should not be relevant to it. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src/components/LeftSidebar/LeftSidebar.vue')
-rw-r--r--src/components/LeftSidebar/LeftSidebar.vue12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/components/LeftSidebar/LeftSidebar.vue b/src/components/LeftSidebar/LeftSidebar.vue
index c526991ac..03e07561f 100644
--- a/src/components/LeftSidebar/LeftSidebar.vue
+++ b/src/components/LeftSidebar/LeftSidebar.vue
@@ -260,14 +260,14 @@ export default {
}
}, 30000)
- EventBus.$on('should-refresh-conversations', this.debounceFetchConversations)
+ EventBus.$on('should-refresh-conversations', this.handleShouldRefreshConversations)
EventBus.$once('conversations-received', this.handleUnreadMention)
this.mountArrowNavigation()
},
beforeDestroy() {
- EventBus.$off('should-refresh-conversations', this.debounceFetchConversations)
+ EventBus.$off('should-refresh-conversations', this.handleShouldRefreshConversations)
EventBus.$off('conversations-received', this.handleUnreadMention)
this.cancelSearchPossibleConversations()
@@ -439,6 +439,14 @@ export default {
return conversation2.lastActivity - conversation1.lastActivity
},
+ async handleShouldRefreshConversations(token, properties) {
+ if (token && properties) {
+ await this.$store.dispatch('setConversationProperties', { token, properties })
+ }
+
+ this.debounceFetchConversations()
+ },
+
debounceFetchConversations: debounce(function() {
if (!this.isFetchingConversations) {
this.fetchConversations()