upd: switch `isIdConfirmed` back to `isIdNotConfirmed`

This commit is contained in:
Marie 2024-09-14 17:52:11 +02:00
parent 2726e7e546
commit 2c241f8d3b
No known key found for this signature in database
GPG Key ID: 7ADF6C9CD9A28555
2 changed files with 7 additions and 7 deletions

View File

@ -187,14 +187,14 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter {
public currentRoute: ShallowRef<RouteDef>; public currentRoute: ShallowRef<RouteDef>;
private currentPath: string; private currentPath: string;
private isLoggedIn: boolean; private isLoggedIn: boolean;
private isIdConfirmed: boolean; private isIdNotConfirmed: boolean;
private notFoundPageComponent: Component; private notFoundPageComponent: Component;
private currentKey = Date.now().toString(); private currentKey = Date.now().toString();
private redirectCount = 0; private redirectCount = 0;
public navHook: ((path: string, flag?: any) => boolean) | null = null; 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(); super();
this.routes = routes; this.routes = routes;
@ -203,7 +203,7 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter {
this.currentRoute = shallowRef(this.current.route); this.currentRoute = shallowRef(this.current.route);
this.currentPath = currentPath; this.currentPath = currentPath;
this.isLoggedIn = isLoggedIn; this.isLoggedIn = isLoggedIn;
this.isIdConfirmed = isIdConfirmed; this.isIdNotConfirmed = isIdNotConfirmed;
this.notFoundPageComponent = notFoundPageComponent; this.notFoundPageComponent = notFoundPageComponent;
} }
@ -369,7 +369,7 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter {
res.props.set('showLoginPopup', true); res.props.set('showLoginPopup', true);
} }
if (res.route.idRequired && !this.isIdConfirmed) { if (res.route.idRequired && this.isIdNotConfirmed) {
res.route.component = this.notFoundPageComponent; res.route.component = this.notFoundPageComponent;
res.props.set('showIdConfirm', true); res.props.set('showIdConfirm', true);
} }

View File

@ -572,7 +572,7 @@ const routes: RouteDef[] = [{
path: '/timeline/antenna/:antennaId', path: '/timeline/antenna/:antennaId',
component: page(() => import('@/pages/antenna-timeline.vue')), component: page(() => import('@/pages/antenna-timeline.vue')),
loginRequired: true, loginRequired: true,
idRequired: userNeedsChecking || !noUserButCheckRequired, idRequired: userNeedsChecking || noUserButCheckRequired,
}, { }, {
path: '/clicker', path: '/clicker',
component: page(() => import('@/pages/clicker.vue')), component: page(() => import('@/pages/clicker.vue')),
@ -613,10 +613,10 @@ const routes: RouteDef[] = [{
component: page(() => import('@/pages/not-found.vue')), 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 { 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')));
} }
/** /**