From 67f3604ae4ecec73e317884085a49ccc4ae64a9e Mon Sep 17 00:00:00 2001 From: varjolintu Date: Sun, 13 Jun 2021 13:17:29 +0300 Subject: [PATCH] TOTP filling fixes --- keepassxc-browser/content/keepassxc-browser.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index 72a11a9..fe939e1 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -889,7 +889,7 @@ kpxc.fillInFromActiveElement = async function(passOnly = false) { return; } - // set focus to the input field + // Set focus to the input field field.focus(); if (kpxc.credentials.length > 1) { @@ -920,7 +920,7 @@ kpxc.fillInFromActiveElement = async function(passOnly = false) { return; } - await sendMessage('page_set_login_id', ''); + await sendMessage('page_set_login_id', kpxc.credentials[0].uuid); kpxc.fillInCredentials(combination, kpxc.credentials[0].login, kpxc.credentials[0].uuid, passOnly); }; @@ -931,7 +931,7 @@ kpxc.fillFromAutofill = async function() { } const index = kpxc.combinations.length - 1; - await sendMessage('page_set_login_id', ''); + await sendMessage('page_set_login_id', kpxc.credentials[0].uuid); kpxc.fillInCredentials(kpxc.combinations[index], kpxc.credentials[0].login, kpxc.credentials[0].uuid); // Generate popup-list of usernames + descriptions @@ -1041,7 +1041,7 @@ kpxc.fillFromUsernameIcon = async function(combination) { return; } - await sendMessage('page_set_login_id', ''); + await sendMessage('page_set_login_id', kpxc.credentials[0].uuid); kpxc.fillInCredentials(combination, kpxc.credentials[0].login, kpxc.credentials[0].uuid); }; @@ -1710,7 +1710,7 @@ kpxc.updateDatabaseState = async function() { // Updates the TOTP Autocomplete Menu kpxc.updateTOTPList = async function() { let uuid = await sendMessage('page_get_login_id'); - if (uuid === undefined) { + if (uuid === undefined || kpxc.credentials.length === 0) { // Credential haven't been selected return; }