Merge pull request #2691 from keepassxreboot/fix/fill_relevant_credential_entry

Fix filling relevant credential entries
This commit is contained in:
Sami Vänttinen 2025-09-20 15:54:18 +03:00 committed by GitHub
commit 10e5b91ece
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -257,11 +257,11 @@ page.retrieveCredentials = async function(tab, args = []) {
return credentials; return credentials;
}; };
page.getLoginId = async function(tab) { page.getLoginId = async function(tab, returnSingle = true) {
const currentTab = page.tabs[tab.id]; const currentTab = page.tabs[tab.id];
// If there's only one credential available and loginId is not set // If there's only one credential available and loginId is not set
if (currentTab && !currentTab.loginId && currentTab.credentials.length === 1) { if (currentTab && returnSingle && !currentTab.loginId && currentTab.credentials.length === 1) {
return currentTab.credentials[0].uuid; return currentTab.credentials[0].uuid;
} }

View file

@ -519,7 +519,7 @@ kpxc.prepareCredentials = async function() {
kpxc.initAutocomplete(); kpxc.initAutocomplete();
if (kpxc.settings.autoFillRelevantCredential) { if (kpxc.settings.autoFillRelevantCredential) {
const pageUuid = await sendMessage('page_get_login_id'); const pageUuid = await sendMessage('page_get_login_id', false);
if (pageUuid) { if (pageUuid) {
const relevantCredential = kpxc.credentials.find(c => c.uuid === pageUuid); const relevantCredential = kpxc.credentials.find(c => c.uuid === pageUuid);
const combination = kpxc.combinations?.at(-1); const combination = kpxc.combinations?.at(-1);