1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[PM-13365] - don't display totp capture when in popout (#12645)

* don't display totp capture when in popout

* add canCaptureTotp method

* dry up logic

* add unit tests

* fix failing tests

* add missing mock to cipher-form story
This commit is contained in:
Jordan Aasen
2025-01-06 13:52:42 -08:00
committed by GitHub
parent 5a46991e4e
commit ddc817689a
6 changed files with 35 additions and 3 deletions

View File

@@ -65,10 +65,14 @@ export class LoginDetailsSectionComponent implements OnInit {
newPasswordGenerated: boolean;
/**
* Whether the TOTP field can be captured from the current tab. Only available in the browser extension.
* Whether the TOTP field can be captured from the current tab. Only available in the browser extension and
* when not in a popout window.
*/
get canCaptureTotp() {
return this.totpCaptureService != null && this.loginDetailsForm.controls.totp.enabled;
return (
!!this.totpCaptureService?.canCaptureTotp(window) &&
this.loginDetailsForm.controls.totp.enabled
);
}
private datePipe = inject(DatePipe);