X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bsearch%2Fsearch-filters.component.ts;h=5972ba553201408f438d72b7a8f0cdb5b19e1137;hb=db581cf7b99eb60d2e6d9bee5c020ef22b0a1a41;hp=59aba22ff8b6a13239ad02ae2ad5ccf9647adbb0;hpb=8f608a4cb22ab232cfab20665050764b38bac9c7;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+search/search-filters.component.ts b/client/src/app/+search/search-filters.component.ts index 59aba22ff..5972ba553 100644 --- a/client/src/app/+search/search-filters.component.ts +++ b/client/src/app/+search/search-filters.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' import { ServerService } from '@app/core' import { AdvancedSearch } from '@app/shared/shared-search' -import { ServerConfig, VideoConstant } from '@shared/models' +import { HTMLServerConfig, VideoConstant } from '@shared/models' type FormOption = { id: string, label: string } @@ -30,7 +30,7 @@ export class SearchFiltersComponent implements OnInit { originallyPublishedStartYear: string originallyPublishedEndYear: string - private serverConfig: ServerConfig + private serverConfig: HTMLServerConfig constructor ( private serverService: ServerService @@ -97,9 +97,7 @@ export class SearchFiltersComponent implements OnInit { } ngOnInit () { - this.serverConfig = this.serverService.getTmpConfig() - this.serverService.getConfig() - .subscribe(config => this.serverConfig = config) + this.serverConfig = this.serverService.getHTMLConfig() this.serverService.getVideoCategories().subscribe(categories => this.videoCategories = categories) this.serverService.getVideoLicences().subscribe(licences => this.videoLicences = licences) @@ -110,14 +108,14 @@ export class SearchFiltersComponent implements OnInit { this.loadOriginallyPublishedAtYears() } - onInputUpdated () { + onDurationOrPublishedUpdated () { this.updateModelFromDurationRange() this.updateModelFromPublishedRange() this.updateModelFromOriginallyPublishedAtYears() } formUpdated () { - this.onInputUpdated() + this.onDurationOrPublishedUpdated() this.filtered.emit(this.advancedSearch) } @@ -129,7 +127,7 @@ export class SearchFiltersComponent implements OnInit { this.durationRange = undefined this.publishedDateRange = undefined - this.onInputUpdated() + this.onDurationOrPublishedUpdated() } resetField (fieldName: string, value?: any) { @@ -138,7 +136,7 @@ export class SearchFiltersComponent implements OnInit { resetLocalField (fieldName: string, value?: any) { this[fieldName] = value - this.onInputUpdated() + this.onDurationOrPublishedUpdated() } resetOriginalPublicationYears () {