1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00: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
2 changed files with 7 additions and 8 deletions

View File

@@ -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,