From 4a6831e0d1a64dab3d429b725cac055bcc532b15 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Mon, 16 Sep 2024 15:31:17 +0200 Subject: [PATCH 1/2] fix(settings): disable Discover when appstore is disabled Signed-off-by: Grigorii K. Shartsev --- apps/settings/src/router/routes.ts | 6 ++++-- apps/settings/src/views/AppStoreNavigation.vue | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/settings/src/router/routes.ts b/apps/settings/src/router/routes.ts index 28adae75d63f6..2944edcc20eb3 100644 --- a/apps/settings/src/router/routes.ts +++ b/apps/settings/src/router/routes.ts @@ -1,4 +1,7 @@ import type { RouteConfig } from 'vue-router' +import { loadState } from '@nextcloud/initial-state' + +const appstoreEnabled = loadState('settings', 'appstoreEnabled', true) // Dynamic loading const AppStore = () => import(/* webpackChunkName: 'settings-apps-view' */'../views/AppStore.vue') @@ -27,11 +30,10 @@ const routes: RouteConfig[] = [ { path: '/:index(index.php/)?settings/apps', name: 'apps', - // redirect to our default route - the app discover section redirect: { name: 'apps-category', params: { - category: 'discover', + category: appstoreEnabled ? 'discover' : 'installed', }, }, components: { diff --git a/apps/settings/src/views/AppStoreNavigation.vue b/apps/settings/src/views/AppStoreNavigation.vue index 1e89cda17c1a8..4d259363be0e6 100644 --- a/apps/settings/src/views/AppStoreNavigation.vue +++ b/apps/settings/src/views/AppStoreNavigation.vue @@ -2,7 +2,8 @@