From 5468f645fbbc15e26bf942f76edcc57f0528e407 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 7182a606309fe..35b3b1306d56e 100644 --- a/apps/settings/src/router/routes.ts +++ b/apps/settings/src/router/routes.ts @@ -3,6 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ 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') @@ -31,11 +34,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 98aee80a802dd..b7ba24c3e4b2b 100644 --- a/apps/settings/src/views/AppStoreNavigation.vue +++ b/apps/settings/src/views/AppStoreNavigation.vue @@ -6,7 +6,8 @@