Merge pull request #1836 from keepassxreboot/fix/remove_icon_from_internal_list

Remove icon input field from the internal list when removing the icon
This commit is contained in:
Sami Vänttinen 2023-01-25 18:24:08 +02:00 committed by GitHub
commit 06b968d60b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -235,6 +235,8 @@ kpxcObserverHelper.handleObserverAdd = async function(target) {
kpxc.prepareCredentials();
}
kpxcIcons.deleteHiddenIcons();
};
// Removes monitored elements

View file

@ -167,6 +167,12 @@ kpxcUI.deleteHiddenIcons = function(iconList, attr) {
icon.removeIcon(attr);
iconList.splice(index, 1);
deletedIcons.push(icon.inputField);
// Delete the input field from detected fields so the icon can be detected again
const inputFieldIndex = kpxc.inputs.indexOf(icon.inputField);
if (inputFieldIndex >= 0) {
kpxc.inputs.splice(inputFieldIndex, 1);
}
}
}