1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-08-05 19:42:52 +02: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,7 +156,12 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
this.platformUtilsService.copyToClipboard(this.totpCode, { window: window });
}
if (this.popupUtilsService.inPopup(window)) {
BrowserApi.closePopup(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(() => {