diff options
author | marco <marcoambrosini@pm.me> | 2021-11-25 12:09:31 +0100 |
---|---|---|
committer | marco <marcoambrosini@pm.me> | 2021-11-25 12:09:31 +0100 |
commit | 449260f9435bece772b0c4d025152157db7c3e93 (patch) | |
tree | d0e326832dce4a7503eff7359143558832711ff6 /src/mixins/getParticipants.js | |
parent | 1f4f5a31eef23eb4b75b08791cb36bdffeccb2da (diff) |
Only call getParticipants methods once in group conversations
Signed-off-by: marco <marcoambrosini@pm.me>
Diffstat (limited to 'src/mixins/getParticipants.js')
-rw-r--r-- | src/mixins/getParticipants.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mixins/getParticipants.js b/src/mixins/getParticipants.js index 33470872b..25070b962 100644 --- a/src/mixins/getParticipants.js +++ b/src/mixins/getParticipants.js @@ -54,23 +54,23 @@ const getParticipants = { }, }, - beforeMount() { - EventBus.$on('route-change', this.onRouteChange) - EventBus.$on('joined-conversation', this.onJoinedConversation) - - // FIXME this works only temporary until signaling is fixed to be only on the calls - // Then we have to search for another solution. Maybe the room list which we update - // periodically gets a hash of all online sessions? - EventBus.$on('signaling-participant-list-changed', this.debounceUpdateParticipants) - }, + methods: { + initialiseGetParticipantsMixin() { + EventBus.$on('route-change', this.onRouteChange) + EventBus.$on('joined-conversation', this.onJoinedConversation) + + // FIXME this works only temporary until signaling is fixed to be only on the calls + // Then we have to search for another solution. Maybe the room list which we update + // periodically gets a hash of all online sessions? + EventBus.$on('signaling-participant-list-changed', this.debounceUpdateParticipants) + }, - beforeDestroy() { - EventBus.$off('route-change', this.onRouteChange) - EventBus.$off('joined-conversation', this.onJoinedConversation) - EventBus.$off('signaling-participant-list-changed', this.debounceUpdateParticipants) - }, + stopGetParticipantsMixin() { + EventBus.$off('route-change', this.onRouteChange) + EventBus.$off('joined-conversation', this.onJoinedConversation) + EventBus.$off('signaling-participant-list-changed', this.debounceUpdateParticipants) + }, - methods: { onRouteChange() { // Reset participantsInitialised when there is only the current user in the participant list this.participantsInitialised = this.$store.getters.participantsList(this.token).length > 1 |