From 9ccd11b6dcf705bfcf5504f0becc4e74e37c8841 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 23 Mar 2023 22:17:05 +0100 Subject: [PATCH] load configuration and then retrieve apps in default side menu display fix #233 --- src/SideMenu.vue | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/SideMenu.vue b/src/SideMenu.vue index c785d46..fd2f24e 100644 --- a/src/SideMenu.vue +++ b/src/SideMenu.vue @@ -93,7 +93,11 @@ export default { for (let id in ncApps) { if (window.topMenuApps.includes(id) && !window.topSideMenuApps.includes(id)) { - continue; + continue + } + + if (this.hiddenApps.includes(id)) { + continue } let app = ncApps[id] @@ -104,10 +108,10 @@ export default { finalApps.sort((a, b) => { if (a.order === null || b.order === null) { - return a.name < b.name ? -1 : 1; + return a.name < b.name ? -1 : 1 } - return a.order < b.order ? -1 : 1; + return a.order < b.order ? -1 : 1 }) this.apps = finalApps @@ -118,24 +122,23 @@ export default { }, retrieveConfig() { - axios - .get(OC.generateUrl('/apps/side_menu/js/config')) - .then((response) => { - const config = response.data - - this.targetBlankApps = config['target-blank-apps'] - this.forceLightIcon = config['force-light-icon'] - this.avatar = config['avatar'] - this.logo = config['logo'] - this.logoLink = config['logo-link'] - this.settings = config['settings'] - this.hiddenApps = config['big-menu-hidden-apps'] - }) }, }, mounted() { - this.retrieveConfig() - this.retrieveApps() + axios + .get(OC.generateUrl('/apps/side_menu/js/config')) + .then((response) => { + const config = response.data + + this.targetBlankApps = config['target-blank-apps'] + this.forceLightIcon = config['force-light-icon'] + this.avatar = config['avatar'] + this.logo = config['logo'] + this.logoLink = config['logo-link'] + this.settings = config['settings'] + this.hiddenApps = config['big-menu-hidden-apps'] + this.retrieveApps() + }) } }