Skip to content

Commit

Permalink
Updated CryptoService DI to use getBgService again (#8146)
Browse files Browse the repository at this point in the history
  • Loading branch information
trmartin4 authored Feb 28, 2024
1 parent ea0f5fa commit 745a0c9
Showing 1 changed file with 3 additions and 31 deletions.
34 changes: 3 additions & 31 deletions apps/browser/src/popup/services/services.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ import { BrowserApi } from "../../platform/browser/browser-api";
import BrowserPopupUtils from "../../platform/popup/browser-popup-utils";
import { BrowserStateService as StateServiceAbstraction } from "../../platform/services/abstractions/browser-state.service";
import { BrowserConfigService } from "../../platform/services/browser-config.service";
import { BrowserCryptoService } from "../../platform/services/browser-crypto.service";
import { BrowserEnvironmentService } from "../../platform/services/browser-environment.service";
import { BrowserFileDownloadService } from "../../platform/services/browser-file-download.service";
import { BrowserI18nService } from "../../platform/services/browser-i18n.service";
Expand Down Expand Up @@ -269,39 +268,12 @@ function getBgService<T>(service: keyof MainBackground) {
},
{
provide: CryptoService,
useFactory: (
keyGenerationService: KeyGenerationService,
cryptoFunctionService: CryptoFunctionService,
encryptService: EncryptService,
platformUtilsService: PlatformUtilsService,
logService: LogServiceAbstraction,
stateService: StateServiceAbstraction,
accountService: AccountServiceAbstraction,
stateProvider: StateProvider,
) => {
const cryptoService = new BrowserCryptoService(
keyGenerationService,
cryptoFunctionService,
encryptService,
platformUtilsService,
logService,
stateService,
accountService,
stateProvider,
);
useFactory: (encryptService: EncryptService) => {
const cryptoService = getBgService<CryptoService>("cryptoService")();
new ContainerService(cryptoService, encryptService).attachToGlobal(self);
return cryptoService;
},
deps: [
KeyGenerationService,
CryptoFunctionService,
EncryptService,
PlatformUtilsService,
LogServiceAbstraction,
StateServiceAbstraction,
AccountServiceAbstraction,
StateProvider,
],
deps: [EncryptService],
},
{
provide: AuthRequestServiceAbstraction,
Expand Down

0 comments on commit 745a0c9

Please sign in to comment.