From ef48ba1ae2b87eecbeb0c5f31a3ddf68ea91ba5a Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Sat, 22 Jan 2022 15:24:12 -0500 Subject: [PATCH] [bug] Correct DI setup for SystemService (#1257) The DI refactor created a bad initlizer for SystemService that left out the reload callback. This callback is null in prod, so I just set up a factory initlizer that used null for the callback value. This fixes a bug causing clipboard clearing to not function, as platformUtilsService was not correctly injected. --- jslib | 2 +- src/app/services.module.ts | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/jslib b/jslib index 54c6a4b3..074f1ee7 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 54c6a4b3c3d34fe6adbbeba5d35a416a3fbc487d +Subproject commit 074f1ee7b7b1c866fdb22184505cef1fad005e0c diff --git a/src/app/services.module.ts b/src/app/services.module.ts index e7b367b7..e08e555e 100644 --- a/src/app/services.module.ts +++ b/src/app/services.module.ts @@ -159,13 +159,12 @@ export function initFactory( }, { provide: SystemServiceAbstraction, - useClass: SystemService, - deps: [ - VaultTimeoutServiceAbstraction, - MessagingServiceAbstraction, - PlatformUtilsServiceAbstraction, - StateServiceAbstraction, - ], + useFactory: ( + messagingService: MessagingServiceAbstraction, + platformUtilsService: PlatformUtilsServiceAbstraction, + stateService: StateServiceAbstraction + ) => new SystemService(messagingService, platformUtilsService, null, stateService), + deps: [MessagingServiceAbstraction, PlatformUtilsServiceAbstraction, StateServiceAbstraction], }, { provide: PasswordRepromptServiceAbstraction, useClass: PasswordRepromptService }, NativeMessagingService,