diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-31 14:44:38 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-31 14:46:18 +0200 |
commit | 698a8c65082237c2bfa2f0ceea6c32750a38e888 (patch) | |
tree | a1a28d2277f06faba5f2327e323272a2e013afd7 /client/src/app/shared/shared-main | |
parent | 8ee25e17b88b970703f4df9e74cb4726bbffd837 (diff) | |
download | PeerTube-698a8c65082237c2bfa2f0ceea6c32750a38e888.tar.gz PeerTube-698a8c65082237c2bfa2f0ceea6c32750a38e888.tar.zst PeerTube-698a8c65082237c2bfa2f0ceea6c32750a38e888.zip |
Fix /:@actor redirection
Fixes https://github.com/Chocobozzz/PeerTube/issues/4134
Diffstat (limited to 'client/src/app/shared/shared-main')
-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 | } |