diff options
author | Chocobozzz <me@florianbigard.com> | 2020-07-20 11:37:06 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-07-20 11:37:06 +0200 |
commit | 0bdad52fbbad81e7654adc495088da56a00437df (patch) | |
tree | 206f4693cc7fa62531fdf6830d6bf9fbbdc07cc1 /client/src/app/+search/video-lazy-load.resolver.ts | |
parent | 69a019968e225f1eac4a3df3041f141d0047d7f0 (diff) | |
download | PeerTube-0bdad52fbbad81e7654adc495088da56a00437df.tar.gz PeerTube-0bdad52fbbad81e7654adc495088da56a00437df.tar.zst PeerTube-0bdad52fbbad81e7654adc495088da56a00437df.zip |
Fix issues with external links in search page
Diffstat (limited to 'client/src/app/+search/video-lazy-load.resolver.ts')
-rw-r--r-- | client/src/app/+search/video-lazy-load.resolver.ts | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/client/src/app/+search/video-lazy-load.resolver.ts b/client/src/app/+search/video-lazy-load.resolver.ts index e8b2b8c74..d4fe6ed79 100644 --- a/client/src/app/+search/video-lazy-load.resolver.ts +++ b/client/src/app/+search/video-lazy-load.resolver.ts | |||
@@ -12,20 +12,12 @@ export class VideoLazyLoadResolver implements Resolve<any> { | |||
12 | 12 | ||
13 | resolve (route: ActivatedRouteSnapshot) { | 13 | resolve (route: ActivatedRouteSnapshot) { |
14 | const url = route.params.url | 14 | const url = route.params.url |
15 | const externalRedirect = route.params.externalRedirect | ||
16 | const fromPath = route.params.fromPath | ||
17 | 15 | ||
18 | if (!url) { | 16 | if (!url) { |
19 | console.error('Could not find url param.', { params: route.params }) | 17 | console.error('Could not find url param.', { params: route.params }) |
20 | return this.router.navigateByUrl('/404') | 18 | return this.router.navigateByUrl('/404') |
21 | } | 19 | } |
22 | 20 | ||
23 | if (externalRedirect === 'true') { | ||
24 | window.open(url) | ||
25 | this.router.navigateByUrl(fromPath) | ||
26 | return | ||
27 | } | ||
28 | |||
29 | return this.searchService.searchVideos({ search: url }) | 21 | return this.searchService.searchVideos({ search: url }) |
30 | .pipe( | 22 | .pipe( |
31 | map(result => { | 23 | map(result => { |