diff options
author | Chocobozzz <me@florianbigard.com> | 2019-12-18 15:31:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-12-18 15:40:59 +0100 |
commit | ba430d7516bc5b1324b60571ba7594460969b7fb (patch) | |
tree | df5c6952c82f49a94c0a884bbc97d4a0cbd9f867 /client/src/app/search | |
parent | 5dfb7c1dec8222b0bbccac5b56ad46da1438747e (diff) | |
download | PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.gz PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.zst PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.zip |
Lazy load static objects
Diffstat (limited to 'client/src/app/search')
-rw-r--r-- | client/src/app/search/search-filters.component.ts | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/client/src/app/search/search-filters.component.ts b/client/src/app/search/search-filters.component.ts index 57131fcac..344a260df 100644 --- a/client/src/app/search/search-filters.component.ts +++ b/client/src/app/search/search-filters.component.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Component, EventEmitter, Input, OnInit, Output, SimpleChanges } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
2 | import { ValidatorFn } from '@angular/forms' | 2 | import { ValidatorFn } from '@angular/forms' |
3 | import { VideoValidatorsService } from '@app/shared' | 3 | import { VideoValidatorsService } from '@app/shared' |
4 | import { ServerService } from '@app/core' | 4 | import { ServerService } from '@app/core' |
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { I18n } from '@ngx-translate/i18n-polyfill' |
6 | import { AdvancedSearch } from '@app/search/advanced-search.model' | 6 | import { AdvancedSearch } from '@app/search/advanced-search.model' |
7 | import { VideoConstant } from '../../../../shared' | 7 | import { ServerConfig, VideoConstant } from '../../../../shared' |
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
10 | selector: 'my-search-filters', | 10 | selector: 'my-search-filters', |
@@ -33,6 +33,8 @@ export class SearchFiltersComponent implements OnInit { | |||
33 | originallyPublishedStartYear: string | 33 | originallyPublishedStartYear: string |
34 | originallyPublishedEndYear: string | 34 | originallyPublishedEndYear: string |
35 | 35 | ||
36 | private serverConfig: ServerConfig | ||
37 | |||
36 | constructor ( | 38 | constructor ( |
37 | private i18n: I18n, | 39 | private i18n: I18n, |
38 | private videoValidatorsService: VideoValidatorsService, | 40 | private videoValidatorsService: VideoValidatorsService, |
@@ -99,9 +101,13 @@ export class SearchFiltersComponent implements OnInit { | |||
99 | } | 101 | } |
100 | 102 | ||
101 | ngOnInit () { | 103 | ngOnInit () { |
102 | this.serverService.videoCategoriesLoaded.subscribe(() => this.videoCategories = this.serverService.getVideoCategories()) | 104 | this.serverConfig = this.serverService.getTmpConfig() |
103 | this.serverService.videoLicencesLoaded.subscribe(() => this.videoLicences = this.serverService.getVideoLicences()) | 105 | this.serverService.getConfig() |
104 | this.serverService.videoLanguagesLoaded.subscribe(() => this.videoLanguages = this.serverService.getVideoLanguages()) | 106 | .subscribe(config => this.serverConfig = config) |
107 | |||
108 | this.serverService.getVideoCategories().subscribe(categories => this.videoCategories = categories) | ||
109 | this.serverService.getVideoLicences().subscribe(licences => this.videoLicences = licences) | ||
110 | this.serverService.getVideoLanguages().subscribe(languages => this.videoLanguages = languages) | ||
105 | 111 | ||
106 | this.loadFromDurationRange() | 112 | this.loadFromDurationRange() |
107 | this.loadFromPublishedRange() | 113 | this.loadFromPublishedRange() |