Merge pull request #1902 from keepassxreboot/fix/add_icon_to_unidentified_forms

Fix adding Username Icon to non-identified forms
This commit is contained in:
Sami Vänttinen 2023-04-18 22:11:01 +03:00 committed by GitHub
commit d51e1fc6ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,7 +34,7 @@ kpxcIcons.addIcon = async function(field, iconType) {
}
};
// Adds all necessary icons to a saved form
// Adds all icons from a form struct
kpxcIcons.addIconsFromForm = async function(form) {
const addUsernameIcons = async function(c) {
if (kpxc.settings.showLoginFormIcon && await kpxc.passwordFilledWithExceptions(c) === false) {
@ -93,13 +93,12 @@ kpxcIcons.initIcons = async function(combinations = []) {
await kpxcIcons.addIconsFromForm(form);
}
// Check for other combinations that are not in any form
// Check for other combinations that are not in any form,
// or there's a form that wasn't present in savedForms (and it's not null)
for (const c of combinations) {
if (c.form) {
continue;
if (!c.form || (c.form && !kpxcForm.savedForms.some(sf => sf.form === c.form))) {
await kpxcIcons.addIconsFromForm(c);
}
await kpxcIcons.addIconsFromForm(c);
}
};