diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index 13732ed0f3a..9420e7d4157 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -454,7 +454,7 @@ export default class MainBackground { this.collectionService = new CollectionService( this.cryptoService, this.i18nService, - this.stateService, + this.stateProvider, ); this.syncNotifierService = new SyncNotifierService(); this.organizationService = new BrowserOrganizationService( diff --git a/apps/browser/src/vault/background/service_factories/collection-service.factory.ts b/apps/browser/src/vault/background/service_factories/collection-service.factory.ts index fd576ca12c3..69d5cd6f22f 100644 --- a/apps/browser/src/vault/background/service_factories/collection-service.factory.ts +++ b/apps/browser/src/vault/background/service_factories/collection-service.factory.ts @@ -14,10 +14,8 @@ import { i18nServiceFactory, I18nServiceInitOptions, } from "../../../platform/background/service-factories/i18n-service.factory"; -import { - stateServiceFactory as stateServiceFactory, - StateServiceInitOptions, -} from "../../../platform/background/service-factories/state-service.factory"; +import { stateProviderFactory } from "../../../platform/background/service-factories/state-provider.factory"; +import { StateServiceInitOptions } from "../../../platform/background/service-factories/state-service.factory"; type CollectionServiceFactoryOptions = FactoryOptions; @@ -38,7 +36,7 @@ export function collectionServiceFactory( new CollectionService( await cryptoServiceFactory(cache, opts), await i18nServiceFactory(cache, opts), - await stateServiceFactory(cache, opts), + await stateProviderFactory(cache, opts), ), ); } diff --git a/apps/cli/src/bw.ts b/apps/cli/src/bw.ts index 05ad43128e5..d1c46e9e0b2 100644 --- a/apps/cli/src/bw.ts +++ b/apps/cli/src/bw.ts @@ -87,6 +87,7 @@ import { } from "@bitwarden/common/tools/password-strength"; import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service"; import { SendService } from "@bitwarden/common/tools/send/services/send.service"; +import { UserId } from "@bitwarden/common/types/guid"; import { InternalFolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherService } from "@bitwarden/common/vault/services/cipher.service"; import { CollectionService } from "@bitwarden/common/vault/services/collection.service"; @@ -358,7 +359,7 @@ export class Main { this.collectionService = new CollectionService( this.cryptoService, this.i18nService, - this.stateService, + this.stateProvider, ); this.providerService = new ProviderService(this.stateService); @@ -616,7 +617,7 @@ export class Main { this.settingsService.clear(userId), this.cipherService.clear(userId), this.folderService.clear(userId), - this.collectionService.clear(userId), + this.collectionService.clear(userId as UserId), this.policyService.clear(userId), this.passwordGenerationService.clear(), ]); diff --git a/apps/web/src/app/core/state/state.service.ts b/apps/web/src/app/core/state/state.service.ts index a40a24b2155..b46c2b590a0 100644 --- a/apps/web/src/app/core/state/state.service.ts +++ b/apps/web/src/app/core/state/state.service.ts @@ -19,7 +19,6 @@ import { MigrationRunner } from "@bitwarden/common/platform/services/migration-r import { StateService as BaseStateService } from "@bitwarden/common/platform/services/state.service"; import { SendData } from "@bitwarden/common/tools/send/models/data/send.data"; import { CipherData } from "@bitwarden/common/vault/models/data/cipher.data"; -import { CollectionData } from "@bitwarden/common/vault/models/data/collection.data"; import { Account } from "./account"; import { GlobalState } from "./global-state"; @@ -69,21 +68,6 @@ export class StateService extends BaseStateService { return await super.setEncryptedCiphers(value, options); } - async getEncryptedCollections( - options?: StorageOptions, - ): Promise<{ [id: string]: CollectionData }> { - options = this.reconcileOptions(options, await this.defaultInMemoryOptions()); - return await super.getEncryptedCollections(options); - } - - async setEncryptedCollections( - value: { [id: string]: CollectionData }, - options?: StorageOptions, - ): Promise { - options = this.reconcileOptions(options, await this.defaultInMemoryOptions()); - return await super.setEncryptedCollections(value, options); - } - async getEncryptedSends(options?: StorageOptions): Promise<{ [id: string]: SendData }> { options = this.reconcileOptions(options, await this.defaultInMemoryOptions()); return await super.getEncryptedSends(options); diff --git a/apps/web/src/app/vault/individual-vault/vault-header/vault-header.component.html b/apps/web/src/app/vault/individual-vault/vault-header/vault-header.component.html index 851e252e39a..ca8c71cf5df 100644 --- a/apps/web/src/app/vault/individual-vault/vault-header/vault-header.component.html +++ b/apps/web/src/app/vault/individual-vault/vault-header/vault-header.component.html @@ -28,7 +28,7 @@ aria-hidden="true" > {{ title }} - +