* 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')
{
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: {
<!-- 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>