Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Commit 65ec78f

Browse files
committed
still allow admin route even if no custom routes are loaded in case routes fail to load
1 parent b6813f9 commit 65ec78f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

packages/client/src/route/public.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ function RouterComp({ route }: { route: string }) {
4848
AuthService.doLoginAuto()
4949
}, [])
5050

51-
if (!customRoutes.length || !isLoggedIn.value) {
51+
// still allow admin even if no custom routes are loaded in case routes fail to load
52+
if ((route !== 'admin' && !customRoutes.length) || !isLoggedIn.value) {
5253
return <LoadingCircle message={t('common:loader.loadingRoutes')} />
5354
}
5455

@@ -64,12 +65,12 @@ function RouterComp({ route }: { route: string }) {
6465
case 'studio':
6566
RouteElement = $studio
6667
break
67-
case 'admin':
68-
RouteElement = $admin
69-
break
7068
case 'location':
7169
RouteElement = $location
7270
break
71+
case 'admin':
72+
RouteElement = $admin
73+
break
7374
}
7475

7576
return (

0 commit comments

Comments
 (0)