mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PM-11393] Remove the need for TotpCaptureService in Autofill Options View component (#11093)
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
/**
|
||||
* TODO: PM-10727 - Rename and Refactor this service
|
||||
* This service is being used in both CipherForm and CipherView. Update this service to reflect that
|
||||
*/
|
||||
|
||||
/**
|
||||
* Service to capture TOTP secret from a client application.
|
||||
*/
|
||||
@@ -11,5 +6,4 @@ export abstract class TotpCaptureService {
|
||||
* Captures a TOTP secret and returns it as a string. Returns null if no TOTP secret was found.
|
||||
*/
|
||||
abstract captureTotpSecret(): Promise<string | null>;
|
||||
abstract openAutofillNewTab(loginUri: string): void;
|
||||
}
|
||||
|
||||
@@ -2,18 +2,17 @@ import { CommonModule } from "@angular/common";
|
||||
import { Component, Input } from "@angular/core";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view";
|
||||
import {
|
||||
CardComponent,
|
||||
FormFieldModule,
|
||||
IconButtonModule,
|
||||
SectionComponent,
|
||||
SectionHeaderComponent,
|
||||
TypographyModule,
|
||||
IconButtonModule,
|
||||
} from "@bitwarden/components";
|
||||
|
||||
import { TotpCaptureService } from "../../cipher-form";
|
||||
|
||||
@Component({
|
||||
selector: "app-autofill-options-view",
|
||||
templateUrl: "autofill-options-view.component.html",
|
||||
@@ -32,9 +31,9 @@ import { TotpCaptureService } from "../../cipher-form";
|
||||
export class AutofillOptionsViewComponent {
|
||||
@Input() loginUris: LoginUriView[];
|
||||
|
||||
constructor(private totpCaptureService: TotpCaptureService) {}
|
||||
constructor(private platformUtilsService: PlatformUtilsService) {}
|
||||
|
||||
async openWebsite(selectedUri: string) {
|
||||
await this.totpCaptureService.openAutofillNewTab(selectedUri);
|
||||
openWebsite(selectedUri: string) {
|
||||
this.platformUtilsService.launchUri(selectedUri);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user