aboutsummaryrefslogtreecommitdiffstats
path: root/core/src/components/AppMenu.vue
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/components/AppMenu.vue')
-rw-r--r--core/src/components/AppMenu.vue6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/components/AppMenu.vue b/core/src/components/AppMenu.vue
index 0a337340ccb..2ee91c30f40 100644
--- a/core/src/components/AppMenu.vue
+++ b/core/src/components/AppMenu.vue
@@ -60,6 +60,7 @@
<script>
import { loadState } from '@nextcloud/initial-state'
+import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import NcActions from '@nextcloud/vue/dist/Components/NcActions'
import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink'
@@ -95,14 +96,19 @@ export default {
this.observer = new ResizeObserver(this.resize)
this.observer.observe(this.$el)
this.resize()
+ subscribe('nextcloud:app-menu.refresh', this.setApps)
},
beforeDestroy() {
this.observer.disconnect()
+ unsubscribe('nextcloud:app-menu.refresh', this.setApps)
},
methods: {
setNavigationCounter(id, counter) {
this.$set(this.apps[id], 'unread', counter)
},
+ setApps({ apps }) {
+ this.apps = apps
+ },
resize() {
const availableWidth = this.$el.offsetWidth
let appCount = Math.floor(availableWidth / 50) - 1