diff options
author | Grigorii K. Shartsev <me@shgk.me> | 2024-09-16 15:31:17 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-09-17 08:32:37 +0000 |
commit | 4a6831e0d1a64dab3d429b725cac055bcc532b15 (patch) | |
tree | 3c841ab8c53363d46b02d57626c54aada51eafee /apps/settings | |
parent | b937093d25aff9db1511733506389d84bb80395c (diff) | |
download | nextcloud-server-4a6831e0d1a64dab3d429b725cac055bcc532b15.tar.gz nextcloud-server-4a6831e0d1a64dab3d429b725cac055bcc532b15.zip |
fix(settings): disable Discover when appstore is disabled
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Diffstat (limited to 'apps/settings')
-rw-r--r-- | apps/settings/src/router/routes.ts | 6 | ||||
-rw-r--r-- | 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 28adae75d63..2944edcc20e 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<boolean>('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 1e89cda17c1..4d259363be0 100644 --- a/apps/settings/src/views/AppStoreNavigation.vue +++ b/apps/settings/src/views/AppStoreNavigation.vue @@ -2,7 +2,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> |