1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-19 02:51:14 +02:00

copy totp to clipboard before closing popup

This commit is contained in:
Kyle Spearrin 2017-08-11 23:41:15 -04:00
parent 966927fe3c
commit 690d94d142

View File

@ -83,8 +83,7 @@ angular
chrome.tabs.sendMessage(tabId, { chrome.tabs.sendMessage(tabId, {
command: 'fillForm', command: 'fillForm',
fillScript: fillScript fillScript: fillScript
}, { frameId: pageDetails[i].frameId }, $window.close); }, { frameId: pageDetails[i].frameId }, function () {
if (login.totp && tokenService.getPremium()) { if (login.totp && tokenService.getPremium()) {
totpService.isAutoCopyEnabled().then(function (enabled) { totpService.isAutoCopyEnabled().then(function (enabled) {
if (enabled) { if (enabled) {
@ -96,8 +95,14 @@ angular
if (code) { if (code) {
utilsService.copyToClipboard(code); utilsService.copyToClipboard(code);
} }
$window.close();
}); });
} }
else {
$window.close();
}
});
} }
} }
} }