X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-main%2Frouter%2Factor-redirect-guard.service.ts;h=ce185829c4749d3ff1d9f86b849484e540832372;hb=7137377d097a74087ed062c8071c1aa5c717c7f7;hp=49d61f9451b577f8b400ae4df19a192d81b88ba7;hpb=4d7ce9218a3f695bf3d013cbdce1c5c6a5221927;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts b/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts index 49d61f945..ce185829c 100644 --- a/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts +++ b/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts @@ -22,20 +22,15 @@ export class ActorRedirectGuard implements CanActivate { this.channelService.getVideoChannel(actorName).pipe(this.orUndefined()) ]).pipe( map(([ account, channel ]) => { - if (!account && !channel) { - this.router.navigate([ '/404' ]) - return false - } - if (account) { - this.router.navigate([ `/a/${actorName}` ], { skipLocationChange: true }) + return this.router.parseUrl(`/a/${actorName}`) } if (channel) { - this.router.navigate([ `/c/${actorName}` ], { skipLocationChange: true }) + return this.router.parseUrl(`/c/${actorName}`) } - return true + return this.router.parseUrl('/404') }) ) }