Skip to content

Commit

Permalink
fix: drop redundant resize listeners
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Feb 10, 2025
1 parent 42ba4a3 commit 881eff6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
8 changes: 0 additions & 8 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ export default {
this.$store.dispatch('joinConversation', { token: this.$route.params.token })
}

window.addEventListener('resize', this.onResize)

this.onResize()

window.addEventListener('unload', () => {
console.info('Navigating away, leaving conversation')
if (this.token) {
Expand Down Expand Up @@ -539,10 +535,6 @@ export default {
this.fetchSingleConversation(this.token)
},

onResize() {
this.windowHeight = window.innerHeight - document.getElementById('header').clientHeight
},

preventUnload(event) {
if (!this.warnLeaving && !this.isSendingMessages) {
return
Expand Down
4 changes: 0 additions & 4 deletions src/components/CallView/shared/PresenterOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,11 @@ export default {
},

mounted() {
window.addEventListener('resize', this.updateSize)

this.resizeObserver = new ResizeObserver(this.updateSize)
this.resizeObserver.observe(this.$refs.presenterOverlay.$el.parentElement)
},

beforeDestroy() {
window.removeEventListener('resize', this.updateSize)

if (this.resizeObserver) {
this.resizeObserver.disconnect()
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/MessagesList/MessagesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ export default {
subscribe('networkOnline', this.handleNetworkOnline)
window.addEventListener('focus', this.onWindowFocus)

window.addEventListener('resize', this.updateSize)
this.resizeObserver = new ResizeObserver(this.updateSize)
this.resizeObserver.observe(this.$refs.scroller)

Expand All @@ -368,7 +367,6 @@ export default {
unsubscribe('networkOffline', this.handleNetworkOffline)
unsubscribe('networkOnline', this.handleNetworkOnline)

window.removeEventListener('resize', this.updateSize)
if (this.resizeObserver) {
this.resizeObserver.disconnect()
}
Expand Down

0 comments on commit 881eff6

Please sign in to comment.