aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.module.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/app.module.ts')
-rw-r--r--client/src/app/app.module.ts17
1 files changed, 12 insertions, 5 deletions
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts
index ea53818e1..dfdccbe69 100644
--- a/client/src/app/app.module.ts
+++ b/client/src/app/app.module.ts
@@ -1,4 +1,5 @@
1import 'focus-visible' 1import 'focus-visible'
2import { tap } from 'rxjs/operators'
2import { environment } from 'src/environments/environment' 3import { environment } from 'src/environments/environment'
3import { APP_BASE_HREF, registerLocaleData } from '@angular/common' 4import { APP_BASE_HREF, registerLocaleData } from '@angular/common'
4import { APP_INITIALIZER, NgModule } from '@angular/core' 5import { APP_INITIALIZER, NgModule } from '@angular/core'
@@ -7,7 +8,7 @@ import { ServiceWorkerModule } from '@angular/service-worker'
7import localeOc from '@app/helpers/locales/oc' 8import localeOc from '@app/helpers/locales/oc'
8import { AppRoutingModule } from './app-routing.module' 9import { AppRoutingModule } from './app-routing.module'
9import { AppComponent } from './app.component' 10import { AppComponent } from './app.component'
10import { CoreModule, ServerService } from './core' 11import { CoreModule, PluginService, ServerService } from './core'
11import { EmptyComponent } from './empty.component' 12import { EmptyComponent } from './empty.component'
12import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header' 13import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header'
13import { HighlightPipe } from './header/highlight.pipe' 14import { HighlightPipe } from './header/highlight.pipe'
@@ -26,8 +27,14 @@ import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings
26 27
27registerLocaleData(localeOc, 'oc') 28registerLocaleData(localeOc, 'oc')
28 29
29export function loadConfigFactory (server: ServerService) { 30export function loadConfigFactory (server: ServerService, pluginService: PluginService) {
30 return () => server.loadHTMLConfig() 31 return () => {
32 const result = server.loadHTMLConfig()
33
34 if (result) return result.pipe(tap(() => pluginService.initializePlugins()))
35
36 return pluginService.initializePlugins()
37 }
31} 38}
32 39
33@NgModule({ 40@NgModule({
@@ -75,9 +82,9 @@ export function loadConfigFactory (server: ServerService) {
75 { 82 {
76 provide: APP_INITIALIZER, 83 provide: APP_INITIALIZER,
77 useFactory: loadConfigFactory, 84 useFactory: loadConfigFactory,
78 deps: [ ServerService ], 85 deps: [ ServerService, PluginService ],
79 multi: true 86 multi: true
80 } 87 }
81 ] 88 ]
82}) 89})
83export class AppModule {} 90export class AppModule {}