mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Fix /:@actor redirection
Fixes https://github.com/Chocobozzz/PeerTube/issues/4134
This commit is contained in:
parent
8ee25e17b8
commit
698a8c6508
@ -22,20 +22,15 @@ export class ActorRedirectGuard implements CanActivate {
|
|||||||
this.channelService.getVideoChannel(actorName).pipe(this.orUndefined())
|
this.channelService.getVideoChannel(actorName).pipe(this.orUndefined())
|
||||||
]).pipe(
|
]).pipe(
|
||||||
map(([ account, channel ]) => {
|
map(([ account, channel ]) => {
|
||||||
if (!account && !channel) {
|
|
||||||
this.router.navigate([ '/404' ])
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
if (account) {
|
if (account) {
|
||||||
this.router.navigate([ `/a/${actorName}` ], { skipLocationChange: true })
|
return this.router.parseUrl(`/a/${actorName}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channel) {
|
if (channel) {
|
||||||
this.router.navigate([ `/c/${actorName}` ], { skipLocationChange: true })
|
return this.router.parseUrl(`/c/${actorName}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return this.router.parseUrl('/404')
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user