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

Fix totp copy not working in Chrome (#2067)

* Fix totp copy not working in Chrome

* Only use fix for Chromium-based browsers
This commit is contained in:
Thomas Rittson
2021-09-22 07:36:28 +10:00
committed by GitHub
parent f4fc458542
commit 2449534e9e

View File

@@ -156,7 +156,12 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
this.platformUtilsService.copyToClipboard(this.totpCode, { window: window });
}
if (this.popupUtilsService.inPopup(window)) {
if (this.platformUtilsService.isFirefox() || this.platformUtilsService.isSafari()) {
BrowserApi.closePopup(window);
} else {
// Slight delay to fix bug in Chromium browsers where popup closes without copying totp to clipboard
setTimeout(() => BrowserApi.closePopup(window), 50);
}
}
} catch {
this.ngZone.run(() => {