1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-12-26 16:58:00 +01:00

[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.
This commit is contained in:
Addison Beck 2022-01-22 15:24:12 -05:00 committed by GitHub
parent 33704b016f
commit ef48ba1ae2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

2
jslib

@ -1 +1 @@
Subproject commit 54c6a4b3c3d34fe6adbbeba5d35a416a3fbc487d Subproject commit 074f1ee7b7b1c866fdb22184505cef1fad005e0c

View File

@ -159,13 +159,12 @@ export function initFactory(
}, },
{ {
provide: SystemServiceAbstraction, provide: SystemServiceAbstraction,
useClass: SystemService, useFactory: (
deps: [ messagingService: MessagingServiceAbstraction,
VaultTimeoutServiceAbstraction, platformUtilsService: PlatformUtilsServiceAbstraction,
MessagingServiceAbstraction, stateService: StateServiceAbstraction
PlatformUtilsServiceAbstraction, ) => new SystemService(messagingService, platformUtilsService, null, stateService),
StateServiceAbstraction, deps: [MessagingServiceAbstraction, PlatformUtilsServiceAbstraction, StateServiceAbstraction],
],
}, },
{ provide: PasswordRepromptServiceAbstraction, useClass: PasswordRepromptService }, { provide: PasswordRepromptServiceAbstraction, useClass: PasswordRepromptService },
NativeMessagingService, NativeMessagingService,