Remove factory provider for SystemService

This commit is contained in:
Thomas Rittson 2022-04-28 09:33:14 +10:00
parent b28e32d0de
commit 69ffa42878
1 changed files with 14 additions and 7 deletions

View File

@ -1,4 +1,4 @@
import { APP_INITIALIZER, NgModule } from "@angular/core";
import { APP_INITIALIZER, InjectionToken, NgModule } from "@angular/core";
import {
JslibServicesModule,
@ -45,6 +45,8 @@ import { SearchBarService } from "../layout/search/search-bar.service";
import { InitService } from "./init.service";
const RELOAD_CALLBACK = new InjectionToken<() => any>("RELOAD_CALLBACK");
@NgModule({
imports: [JslibServicesModule],
declarations: [],
@ -67,6 +69,10 @@ import { InitService } from "./init.service";
provide: CLIENT_TYPE,
useValue: ClientType.Desktop,
},
{
provide: RELOAD_CALLBACK,
useValue: null,
},
{ provide: LogServiceAbstraction, useClass: ElectronLogService, deps: [] },
{
provide: PlatformUtilsServiceAbstraction,
@ -103,12 +109,13 @@ import { InitService } from "./init.service";
},
{
provide: SystemServiceAbstraction,
useFactory: (
messagingService: MessagingServiceAbstraction,
platformUtilsService: PlatformUtilsServiceAbstraction,
stateService: StateServiceAbstraction
) => new SystemService(messagingService, platformUtilsService, null, stateService),
deps: [MessagingServiceAbstraction, PlatformUtilsServiceAbstraction, StateServiceAbstraction],
useClass: SystemService,
deps: [
MessagingServiceAbstraction,
PlatformUtilsServiceAbstraction,
RELOAD_CALLBACK,
StateServiceAbstraction,
],
},
{ provide: PasswordRepromptServiceAbstraction, useClass: PasswordRepromptService },
{