aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.module.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-02-20 10:17:03 +0100
committerChocobozzz <me@florianbigard.com>2023-02-20 10:18:05 +0100
commit15825ef18d3b2bb74f4e613496cf3e2921a87389 (patch)
treed68b590baa98b090c212a117317c21059e064725 /client/src/app/app.module.ts
parent5471449f998eec270b184e6080e6f9853e5d722a (diff)
downloadPeerTube-15825ef18d3b2bb74f4e613496cf3e2921a87389.tar.gz
PeerTube-15825ef18d3b2bb74f4e613496cf3e2921a87389.tar.zst
PeerTube-15825ef18d3b2bb74f4e613496cf3e2921a87389.zip
Fix default trending algorithm in admin config
Diffstat (limited to 'client/src/app/app.module.ts')
-rw-r--r--client/src/app/app.module.ts16
1 files changed, 10 insertions, 6 deletions
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts
index bb20c2d83..7e4fac730 100644
--- a/client/src/app/app.module.ts
+++ b/client/src/app/app.module.ts
@@ -8,7 +8,7 @@ import { ServiceWorkerModule } from '@angular/service-worker'
8import localeOc from '@app/helpers/locales/oc' 8import localeOc from '@app/helpers/locales/oc'
9import { AppRoutingModule } from './app-routing.module' 9import { AppRoutingModule } from './app-routing.module'
10import { AppComponent } from './app.component' 10import { AppComponent } from './app.component'
11import { CoreModule, PluginService, ServerService } from './core' 11import { CoreModule, PluginService, RedirectService, ServerService } from './core'
12import { EmptyComponent } from './empty.component' 12import { EmptyComponent } from './empty.component'
13import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header' 13import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header'
14import { HighlightPipe } from './header/highlight.pipe' 14import { HighlightPipe } from './header/highlight.pipe'
@@ -28,13 +28,17 @@ import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings
28 28
29registerLocaleData(localeOc, 'oc') 29registerLocaleData(localeOc, 'oc')
30 30
31export function loadConfigFactory (server: ServerService, pluginService: PluginService) { 31export function loadConfigFactory (server: ServerService, pluginService: PluginService, redirectService: RedirectService) {
32 const initializeServices = () => {
33 redirectService.init()
34 pluginService.initializePlugins()
35 }
36
32 return () => { 37 return () => {
33 const result = server.loadHTMLConfig() 38 const result = server.loadHTMLConfig()
39 if (result) return result.pipe(tap(() => initializeServices()))
34 40
35 if (result) return result.pipe(tap(() => pluginService.initializePlugins())) 41 initializeServices()
36
37 return pluginService.initializePlugins()
38 } 42 }
39} 43}
40 44
@@ -84,7 +88,7 @@ export function loadConfigFactory (server: ServerService, pluginService: PluginS
84 { 88 {
85 provide: APP_INITIALIZER, 89 provide: APP_INITIALIZER,
86 useFactory: loadConfigFactory, 90 useFactory: loadConfigFactory,
87 deps: [ ServerService, PluginService ], 91 deps: [ ServerService, PluginService, RedirectService ],
88 multi: true 92 multi: true
89 } 93 }
90 ] 94 ]