]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(settings): disable Discover when appstore is disabled
authorGrigorii K. Shartsev <me@shgk.me>
Mon, 16 Sep 2024 13:31:17 +0000 (15:31 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 17 Sep 2024 08:34:04 +0000 (08:34 +0000)
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
apps/settings/src/router/routes.ts
apps/settings/src/views/AppStoreNavigation.vue

index 7182a606309fef1d1870628a043f14e4e5967d21..35b3b1306d56e2248b3c9075744925babf712394 100644 (file)
@@ -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<boolean>('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: {
index 98aee80a802dd6431e1970cbd98f67de67bcdcd9..b7ba24c3e4b2b1ee2eab37adbe5119e44db03bfc 100644 (file)
@@ -6,7 +6,8 @@
        <!-- Categories & filters -->
        <NcAppNavigation :aria-label="t('settings', 'Apps')">
                <template #list>
-                       <NcAppNavigationItem id="app-category-discover"
+                       <NcAppNavigationItem v-if="appstoreEnabled"
+                               id="app-category-discover"
                                :to="{ name: 'apps-category', params: { category: 'discover'} }"
                                :name="APPS_SECTION_ENUM.discover">
                                <template #icon>