From ddac10136f9692767f986b88062c90016d41cff3 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Tue, 12 Mar 2024 11:12:12 -0500 Subject: [PATCH] Fix missed service dependency changes (#8305) --- apps/browser/src/background/main.background.ts | 2 +- .../service-factories/app-id-service.factory.ts | 11 ++++++----- apps/cli/src/bw.ts | 2 +- libs/angular/src/services/jslib-services.module.ts | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index 9d5f6943ece..07306f24d17 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -458,7 +458,7 @@ export default class MainBackground { this.biometricStateService, ); this.tokenService = new TokenService(this.stateService); - this.appIdService = new AppIdService(this.storageService); + this.appIdService = new AppIdService(this.globalStateProvider); this.apiService = new ApiService( this.tokenService, this.platformUtilsService, diff --git a/apps/browser/src/platform/background/service-factories/app-id-service.factory.ts b/apps/browser/src/platform/background/service-factories/app-id-service.factory.ts index af5012798b8..c43584cba72 100644 --- a/apps/browser/src/platform/background/service-factories/app-id-service.factory.ts +++ b/apps/browser/src/platform/background/service-factories/app-id-service.factory.ts @@ -1,14 +1,15 @@ -import { DiskStorageOptions } from "@koa/multer"; - import { AppIdService as AbstractAppIdService } from "@bitwarden/common/platform/abstractions/app-id.service"; import { AppIdService } from "@bitwarden/common/platform/services/app-id.service"; import { FactoryOptions, CachedServices, factory } from "./factory-options"; -import { diskStorageServiceFactory } from "./storage-service.factory"; +import { + GlobalStateProviderInitOptions, + globalStateProviderFactory, +} from "./global-state-provider.factory"; type AppIdServiceFactoryOptions = FactoryOptions; -export type AppIdServiceInitOptions = AppIdServiceFactoryOptions & DiskStorageOptions; +export type AppIdServiceInitOptions = AppIdServiceFactoryOptions & GlobalStateProviderInitOptions; export function appIdServiceFactory( cache: { appIdService?: AbstractAppIdService } & CachedServices, @@ -18,6 +19,6 @@ export function appIdServiceFactory( cache, "appIdService", opts, - async () => new AppIdService(await diskStorageServiceFactory(cache, opts)), + async () => new AppIdService(await globalStateProviderFactory(cache, opts)), ); } diff --git a/apps/cli/src/bw.ts b/apps/cli/src/bw.ts index 9718bb8f100..145065a99b4 100644 --- a/apps/cli/src/bw.ts +++ b/apps/cli/src/bw.ts @@ -333,7 +333,7 @@ export class Main { this.stateProvider, ); - this.appIdService = new AppIdService(this.storageService); + this.appIdService = new AppIdService(this.globalStateProvider); this.tokenService = new TokenService(this.stateService); const customUserAgent = diff --git a/libs/angular/src/services/jslib-services.module.ts b/libs/angular/src/services/jslib-services.module.ts index 5c83bc880c0..43344a6894f 100644 --- a/libs/angular/src/services/jslib-services.module.ts +++ b/libs/angular/src/services/jslib-services.module.ts @@ -290,7 +290,7 @@ import { ModalService } from "./modal.service"; { provide: AppIdServiceAbstraction, useClass: AppIdService, - deps: [AbstractStorageService], + deps: [GlobalStateProvider], }, { provide: AuditServiceAbstraction,