Skip to content

Commit

Permalink
Use resize observer
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Aug 30, 2022
1 parent 0c3f4c9 commit ca43271
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/components/AppMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default {
return {
apps: loadState('core', 'apps', {}),
appLimit: 0,
observer: null,
}
},
computed: {
Expand All @@ -87,9 +88,13 @@ export default {
},
},
mounted() {
window.addEventListener('resize', this.resize)
this.observer = new ResizeObserver(this.resize)
this.observer.observe(this.$el)
this.resize()
},
beforeDestroy() {
this.observer.disconnect()
},
methods: {
setNavigationCounter(id, counter) {
this.$set(this.apps[id], 'unread', counter)
Expand Down

0 comments on commit ca43271

Please sign in to comment.