This commit is contained in:
rr-bw 2024-05-22 07:48:05 -07:00 committed by GitHub
parent 8f65a48ede
commit 623cda8b64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 24 additions and 19 deletions

View File

@ -16,6 +16,8 @@ import { concat, Observable, Subject, lastValueFrom, combineLatest, firstValueFr
import { filter, map, takeUntil } from "rxjs/operators";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { safeProvider, SafeProvider } from "@bitwarden/angular/platform/utils/safe-provider";
import { PinServiceAbstraction } from "@bitwarden/auth/common";
import { ApiService } from "@bitwarden/common/abstractions/api.service";
import {
canAccessImport,
@ -64,6 +66,27 @@ import {
} from "./dialog";
import { ImportLastPassComponent } from "./lastpass";
const safeProviders: SafeProvider[] = [
safeProvider({
provide: ImportApiServiceAbstraction,
useClass: ImportApiService,
deps: [ApiService],
}),
safeProvider({
provide: ImportServiceAbstraction,
useClass: ImportService,
deps: [
CipherService,
FolderService,
ImportApiServiceAbstraction,
I18nService,
CollectionService,
CryptoService,
PinServiceAbstraction,
],
}),
];
@Component({
selector: "tools-import",
templateUrl: "import.component.html",
@ -81,25 +104,7 @@ import { ImportLastPassComponent } from "./lastpass";
ImportLastPassComponent,
RadioButtonModule,
],
providers: [
{
provide: ImportApiServiceAbstraction,
useClass: ImportApiService,
deps: [ApiService],
},
{
provide: ImportServiceAbstraction,
useClass: ImportService,
deps: [
CipherService,
FolderService,
ImportApiServiceAbstraction,
I18nService,
CollectionService,
CryptoService,
],
},
],
providers: safeProviders,
})
export class ImportComponent implements OnInit, OnDestroy {
featuredImportOptions: ImportOption[];