]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts
Auto update publishedAt in live restream
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / router / actor-redirect-guard.service.ts
index 49d61f9451b577f8b400ae4df19a192d81b88ba7..ce185829c4749d3ff1d9f86b849484e540832372 100644 (file)
@@ -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')
       })
     )
   }