From 698a8c65082237c2bfa2f0ceea6c32750a38e888 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 31 May 2021 14:44:38 +0200 Subject: Fix /:@actor redirection Fixes https://github.com/Chocobozzz/PeerTube/issues/4134 --- .../shared/shared-main/router/actor-redirect-guard.service.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts') 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') }) ) } -- cgit v1.2.3