Merge pull request #1988 from keepassxreboot/fix/fill_from_combination_2nd

Use the first combination if active element is not found
This commit is contained in:
Sami Vänttinen 2023-09-17 14:28:40 +03:00 committed by GitHub
commit 65ad31d30f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,8 +48,8 @@ kpxcFill.fillInFromActiveElement = async function(passOnly = false) {
// Fill from combination, if found
kpxcFill.fillFromCombination = async function(elem, passOnly) {
const combination = passOnly
? kpxc.combinations.find(c => c.password === elem)
: kpxc.combinations.find(c => c.username === elem);
? kpxc.combinations.find(c => c.password === elem) ?? kpxc.combinations.find(c => c.password)
: kpxc.combinations.find(c => c.username === elem) ?? kpxc.combinations.find(c => c.username);
if (!combination) {
logDebug('Error: No username/password field combination found.');
return false;