]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/header/search-typeahead.component.ts
Better display of accounts and channel pages on small screens
[github/Chocobozzz/PeerTube.git] / client / src / app / header / search-typeahead.component.ts
index 372601fa82c2c6a5fee8332d73143dc77aacce87..396a875c872c0f6f63ae98814887e9ce74b12da0 100644 (file)
@@ -35,9 +35,9 @@ export class SearchTypeaheadComponent implements OnInit, OnDestroy {
   ) {}
 
   ngOnInit () {
-    const query = this.route.snapshot.queryParams
-    if (query['search']) this.search = query['search']
-
+    this.route.queryParams
+      .pipe(first(params => params.search !== undefined && params.search !== null))
+      .subscribe(params => this.search = params.search)
     this.serverService.getConfig()
       .subscribe(config => this.serverConfig = config)
   }