From 15825ef18d3b2bb74f4e613496cf3e2921a87389 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 20 Feb 2023 10:17:03 +0100 Subject: Fix default trending algorithm in admin config --- client/src/app/app.module.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'client/src/app/app.module.ts') 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 } ] -- cgit v1.2.3