X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fapp.module.ts;h=7e4fac730fee05aec961e4d85a3e8a835fe620c5;hb=52798aa5f277492d4dd2482bca9396d2e982fa19;hp=bb20c2d83f2bca1ce15aeb862b09468384a38ea9;hpb=8f581725651c4b2c213d75fc028e306bbf239d3e;p=github%2FChocobozzz%2FPeerTube.git 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' import localeOc from '@app/helpers/locales/oc' import { AppRoutingModule } from './app-routing.module' import { AppComponent } from './app.component' -import { CoreModule, PluginService, ServerService } from './core' +import { CoreModule, PluginService, RedirectService, ServerService } from './core' import { EmptyComponent } from './empty.component' import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header' import { HighlightPipe } from './header/highlight.pipe' @@ -28,13 +28,17 @@ import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings registerLocaleData(localeOc, 'oc') -export function loadConfigFactory (server: ServerService, pluginService: PluginService) { +export function loadConfigFactory (server: ServerService, pluginService: PluginService, redirectService: RedirectService) { + const initializeServices = () => { + redirectService.init() + pluginService.initializePlugins() + } + return () => { const result = server.loadHTMLConfig() + if (result) return result.pipe(tap(() => initializeServices())) - if (result) return result.pipe(tap(() => pluginService.initializePlugins())) - - return pluginService.initializePlugins() + initializeServices() } } @@ -84,7 +88,7 @@ export function loadConfigFactory (server: ServerService, pluginService: PluginS { provide: APP_INITIALIZER, useFactory: loadConfigFactory, - deps: [ ServerService, PluginService ], + deps: [ ServerService, PluginService, RedirectService ], multi: true } ]