diff options
-rw-r--r-- | core/src/components/AppMenu.vue | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/src/components/AppMenu.vue b/core/src/components/AppMenu.vue index 88f626ff569..1bf1af8d24c 100644 --- a/core/src/components/AppMenu.vue +++ b/core/src/components/AppMenu.vue @@ -88,10 +88,12 @@ export default defineComponent({ mounted() { subscribe('nextcloud:app-menu.refresh', this.setApps) + subscribe('nextcloud:app-menu.active', this.setActive) }, beforeDestroy() { unsubscribe('nextcloud:app-menu.refresh', this.setApps) + unsubscribe('nextcloud:app-menu.active', this.setActive) }, methods: { @@ -104,6 +106,19 @@ export default defineComponent({ } }, + setActive(id: string) { + this.appList.forEach((app) => { + this.$set(app, 'active', false) + }) + + const app = this.appList.find(({ id: menuItemId }) => menuItemId === id) + if (app) { + this.$set(app, 'active', true) + } else { + logger.warn(`Could not find app "${id}" for setting navigation count`) + } + }, + setApps({ apps }: { apps: INavigationEntry[]}) { this.appList = apps }, |