]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/header/search-typeahead.component.ts
Cleanup lives on server restart
[github/Chocobozzz/PeerTube.git] / client / src / app / header / search-typeahead.component.ts
index 6c8b8efee30f549898792919574178f988662d9f..c546628ee66fb52b820fad529aed4de46fe4dd76 100644 (file)
@@ -1,11 +1,10 @@
 import { of } from 'rxjs'
-import { first, tap, delay } from 'rxjs/operators'
+import { first, tap } from 'rxjs/operators'
 import { ListKeyManager } from '@angular/cdk/a11y'
-import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, QueryList, ViewChild, ViewChildren, AfterViewChecked } from '@angular/core'
+import { AfterViewChecked, AfterViewInit, Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core'
 import { ActivatedRoute, Params, Router } from '@angular/router'
 import { AuthService, ServerService } from '@app/core'
-import { ServerConfig } from '@shared/models'
-import { SearchTargetType } from '@shared/models/search/search-target-query.model'
+import { SearchTargetType, ServerConfig } from '@shared/models'
 import { SuggestionComponent, SuggestionPayload, SuggestionPayloadType } from './suggestion.component'
 
 @Component({
@@ -112,10 +111,10 @@ export class SearchTypeaheadComponent implements OnInit, AfterViewInit, AfterVie
     const searchIndexConfig = this.serverConfig.search.searchIndex
 
     if (!this.activeSearch) {
-      if (searchIndexConfig.enabled && searchIndexConfig.isDefaultSearch) {
-        this.activeSearch = 'search-instance'
-      } else {
+      if (searchIndexConfig.enabled && (searchIndexConfig.isDefaultSearch || searchIndexConfig.disableLocalSearch)) {
         this.activeSearch = 'search-index'
+      } else {
+        this.activeSearch = 'search-instance'
       }
     }