Skip to content

Commit

Permalink
Fix event handler deregistration in TopBar
Browse files Browse the repository at this point in the history
Even if their code is identical two arrow functions are different
instances, so the original one was not properly deregistered.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
  • Loading branch information
danxuliu committed Sep 15, 2020
1 parent a016fa2 commit 47c615e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/components/TopBar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,7 @@ export default {
document.addEventListener('MSFullscreenChange', this.fullScreenChanged, false)
document.addEventListener('webkitfullscreenchange', this.fullScreenChanged, false)
// Add call layout hint listener
EventBus.$on('toggleLayoutHint', (display) => {
this.showLayoutHint = display
})
EventBus.$on('toggleLayoutHint', this.handleToggleLayoutHint)
},
beforeDestroy() {
Expand All @@ -370,9 +368,7 @@ export default {
document.removeEventListener('MSFullscreenChange', this.fullScreenChanged, false)
document.removeEventListener('webkitfullscreenchange', this.fullScreenChanged, false)
// Remove call layout hint listener
EventBus.$off('toggleLayoutHint', (display) => {
this.showLayoutHint = display
})
EventBus.$off('toggleLayoutHint', this.handleToggleLayoutHint)
},
methods: {
Expand Down Expand Up @@ -489,6 +485,9 @@ export default {
this.$store.dispatch('isRenamingConversation', true)
this.$store.dispatch('showSidebar')
},
handleToggleLayoutHint(display) {
this.showLayoutHint = display
},
forceMuteOthers() {
callParticipantCollection.callParticipantModels.forEach(callParticipantModel => {
callParticipantModel.forceMute()
Expand Down

0 comments on commit 47c615e

Please sign in to comment.