fix(settings): disable Discover when appstore is disabled

Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
pull/48090/head
Grigorii K. Shartsev 2024-09-16 15:31:17 +07:00
parent cfed24cb02
commit eab54788a2
2 changed files with 6 additions and 3 deletions

@ -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: {

@ -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>