1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

[PM-6195] Refactor injection of services in browser services module (Pt2) (#8849)

* Remove UsernameGenerationService from popup/services.module

* Remove PasswordGenerationService from popup/services.module

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith
2024-05-20 15:49:47 +02:00
committed by GitHub
parent 034227d993
commit fe81470f36

View File

@@ -81,8 +81,6 @@ import {
} from "@bitwarden/common/platform/state"; } from "@bitwarden/common/platform/state";
// eslint-disable-next-line import/no-restricted-paths -- Used for dependency injection // eslint-disable-next-line import/no-restricted-paths -- Used for dependency injection
import { InlineDerivedStateProvider } from "@bitwarden/common/platform/state/implementations/inline-derived-state"; import { InlineDerivedStateProvider } from "@bitwarden/common/platform/state/implementations/inline-derived-state";
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
import { UsernameGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/username";
import { VaultTimeoutStringType } from "@bitwarden/common/types/vault-timeout.type"; import { VaultTimeoutStringType } from "@bitwarden/common/types/vault-timeout.type";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service";
@@ -317,11 +315,6 @@ const safeProviders: SafeProvider[] = [
}, },
deps: [ToastService, OffscreenDocumentService], deps: [ToastService, OffscreenDocumentService],
}), }),
safeProvider({
provide: PasswordGenerationServiceAbstraction,
useFactory: getBgService<PasswordGenerationServiceAbstraction>("passwordGenerationService"),
deps: [],
}),
safeProvider({ safeProvider({
provide: SyncService, provide: SyncService,
useFactory: getBgService<SyncService>("syncService"), useFactory: getBgService<SyncService>("syncService"),
@@ -482,11 +475,6 @@ const safeProviders: SafeProvider[] = [
MigrationRunner, MigrationRunner,
], ],
}), }),
safeProvider({
provide: UsernameGenerationServiceAbstraction,
useFactory: getBgService<UsernameGenerationServiceAbstraction>("usernameGenerationService"),
deps: [],
}),
safeProvider({ safeProvider({
provide: BaseStateServiceAbstraction, provide: BaseStateServiceAbstraction,
useExisting: StateServiceAbstraction, useExisting: StateServiceAbstraction,