]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/header/suggestion.component.ts
Improve search typeahead performance and use native events
[github/Chocobozzz/PeerTube.git] / client / src / app / header / suggestion.component.ts
index bdcb3e03feff8c898e83e14bec60b3c6af57db97..69641b511b9612f55c40fe3155bb980f301b2808 100644 (file)
@@ -1,6 +1,5 @@
-import { Input, Component, Output, EventEmitter, OnInit } from '@angular/core'
+import { Input, Component, Output, EventEmitter, OnInit, ChangeDetectionStrategy } from '@angular/core'
 import { RouterLink } from '@angular/router'
-import { I18n } from '@ngx-translate/i18n-polyfill'
 import { ListKeyManagerOption } from '@angular/cdk/a11y'
 
 export type Result = {
@@ -13,28 +12,17 @@ export type Result = {
 @Component({
   selector: 'my-suggestion',
   templateUrl: './suggestion.component.html',
-  styleUrls: [ './suggestion.component.scss' ]
+  styleUrls: [ './suggestion.component.scss' ],
+  changeDetection: ChangeDetectionStrategy.OnPush
 })
 export class SuggestionComponent implements OnInit, ListKeyManagerOption {
   @Input() result: Result
   @Input() highlight: string
   @Output() selected = new EventEmitter()
 
-  inAllText: string
-  inThisChannelText: string
-  inThisInstanceText: string
-
   disabled = false
   active = false
 
-  constructor (
-    private i18n: I18n
-  ) {
-    this.inAllText = this.i18n('In the vidiverse')
-    this.inThisChannelText = this.i18n('In this channel')
-    this.inThisInstanceText = this.i18n('In this instance')
-  }
-
   getLabel () {
     return this.result.text
   }