diff options
Diffstat (limited to 'client/src/app')
-rw-r--r-- | client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts | 11 |
1 files changed, 3 insertions, 8 deletions
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 { | |||
22 | this.channelService.getVideoChannel(actorName).pipe(this.orUndefined()) | 22 | this.channelService.getVideoChannel(actorName).pipe(this.orUndefined()) |
23 | ]).pipe( | 23 | ]).pipe( |
24 | map(([ account, channel ]) => { | 24 | map(([ account, channel ]) => { |
25 | if (!account && !channel) { | ||
26 | this.router.navigate([ '/404' ]) | ||
27 | return false | ||
28 | } | ||
29 | |||
30 | if (account) { | 25 | if (account) { |
31 | this.router.navigate([ `/a/${actorName}` ], { skipLocationChange: true }) | 26 | return this.router.parseUrl(`/a/${actorName}`) |
32 | } | 27 | } |
33 | 28 | ||
34 | if (channel) { | 29 | if (channel) { |
35 | this.router.navigate([ `/c/${actorName}` ], { skipLocationChange: true }) | 30 | return this.router.parseUrl(`/c/${actorName}`) |
36 | } | 31 | } |
37 | 32 | ||
38 | return true | 33 | return this.router.parseUrl('/404') |
39 | }) | 34 | }) |
40 | ) | 35 | ) |
41 | } | 36 | } |