From 1f217455f3aa99fe95e91ae3a3fb1f958a428218 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 25 Apr 2023 11:13:01 +0200 Subject: [PATCH] feat: define root meta for root redirect --- packages/web-app-webfinger/src/index.ts | 8 +++----- packages/web-runtime/src/container/bootstrap.ts | 7 ++++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/web-app-webfinger/src/index.ts b/packages/web-app-webfinger/src/index.ts index 11fc257e97f..0292a2be524 100644 --- a/packages/web-app-webfinger/src/index.ts +++ b/packages/web-app-webfinger/src/index.ts @@ -15,13 +15,10 @@ const appInfo = { const routes = () => [ { - name: 'root', + name: 'webfinger-root', path: '/', redirect: () => { return { name: 'webfinger-resolve' } - }, - meta: { - root: true } }, { @@ -30,7 +27,8 @@ const routes = () => [ component: Resolve, meta: { authContext: 'user', - title: $gettext('Resolve ownCloud') + title: $gettext('Resolve ownCloud'), + entryPoint: true } } ] diff --git a/packages/web-runtime/src/container/bootstrap.ts b/packages/web-runtime/src/container/bootstrap.ts index b9871763223..fffc60f5879 100644 --- a/packages/web-runtime/src/container/bootstrap.ts +++ b/packages/web-runtime/src/container/bootstrap.ts @@ -368,7 +368,12 @@ export const announceDefaults = ({ defaultExtensionId = appIds[0] } - const route = store.getters.getNavItemsByExtension(defaultExtensionId)[0]?.route + let route = router.getRoutes().find((r) => { + return r.path.startsWith(`/${defaultExtensionId}`) && r.meta?.entryPoint === true + }) + if (!route) { + route = store.getters.getNavItemsByExtension(defaultExtensionId)[0]?.route + } if (route) { router.addRoute({ path: '/',