diff --git a/packages/frontend/src/nirax.ts b/packages/frontend/src/nirax.ts index bd91e51736..12d066d7ec 100644 --- a/packages/frontend/src/nirax.ts +++ b/packages/frontend/src/nirax.ts @@ -187,14 +187,14 @@ export class Router extends EventEmitter implements IRouter { public currentRoute: ShallowRef; private currentPath: string; private isLoggedIn: boolean; - private isIdConfirmed: boolean; + private isIdNotConfirmed: boolean; private notFoundPageComponent: Component; private currentKey = Date.now().toString(); private redirectCount = 0; public navHook: ((path: string, flag?: any) => boolean) | null = null; - constructor(routes: Router['routes'], currentPath: Router['currentPath'], isLoggedIn: boolean, isIdConfirmed: boolean, notFoundPageComponent: Component) { + constructor(routes: Router['routes'], currentPath: Router['currentPath'], isLoggedIn: boolean, isIdNotConfirmed: boolean, notFoundPageComponent: Component) { super(); this.routes = routes; @@ -203,7 +203,7 @@ export class Router extends EventEmitter implements IRouter { this.currentRoute = shallowRef(this.current.route); this.currentPath = currentPath; this.isLoggedIn = isLoggedIn; - this.isIdConfirmed = isIdConfirmed; + this.isIdNotConfirmed = isIdNotConfirmed; this.notFoundPageComponent = notFoundPageComponent; } @@ -369,7 +369,7 @@ export class Router extends EventEmitter implements IRouter { res.props.set('showLoginPopup', true); } - if (res.route.idRequired && !this.isIdConfirmed) { + if (res.route.idRequired && this.isIdNotConfirmed) { res.route.component = this.notFoundPageComponent; res.props.set('showIdConfirm', true); } diff --git a/packages/frontend/src/router/definition.ts b/packages/frontend/src/router/definition.ts index d9abd335a9..6bfc412cbd 100644 --- a/packages/frontend/src/router/definition.ts +++ b/packages/frontend/src/router/definition.ts @@ -572,7 +572,7 @@ const routes: RouteDef[] = [{ path: '/timeline/antenna/:antennaId', component: page(() => import('@/pages/antenna-timeline.vue')), loginRequired: true, - idRequired: userNeedsChecking || !noUserButCheckRequired, + idRequired: userNeedsChecking || noUserButCheckRequired, }, { path: '/clicker', component: page(() => import('@/pages/clicker.vue')), @@ -613,10 +613,10 @@ const routes: RouteDef[] = [{ component: page(() => import('@/pages/not-found.vue')), }]; -const isIdConfirmedCheck = userNeedsChecking ? false : true || noUserButCheckRequired ? false : true || userNotVerifiedYet ? false : true; +const isIdNotConfirmedCheck = userNeedsChecking || noUserButCheckRequired || userNotVerifiedYet; function createRouterImpl(path: string): IRouter { - return new Router(routes, path, !!$i, isIdConfirmedCheck, page(() => import('@/pages/not-found.vue'))); + return new Router(routes, path, !!$i, isIdNotConfirmedCheck, page(() => import('@/pages/not-found.vue'))); } /**