Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions keepassxc-browser/content/icon-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ kpxcIcons.addIconsFromForm = async function(form) {
}
}

if (c.username && !c.username.readOnly) {
if (c.username && !c.username.readOnly && kpxcFields.isVisible(c.username)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use:
const usernameFieldVisible = c.username && kpxcFields.isVisible(c.username);

kpxcIcons.addIcon(c.username, kpxcIcons.iconTypes.DEFAULT);
} else if (c.password && (!c.username || (c.username && c.username.readOnly))) {
// Single password field
} else if (c.password && (!c.username || c.username.readOnly || !kpxcFields.isVisible(c.username))) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be:
} else if (c.password && (!c.username || (c.username && (c.username.readOnly || !usernameFieldVisible)))) {

So the single password field applies if:

  • Password field is defined
  • Usename field is not found OR
  • Username field is found, but is readOnly or not visible

// Single password field, or username field is hidden (e.g. two-step login)
Comment thread
varjolintu marked this conversation as resolved.
Outdated
kpxcIcons.addIcon(c.password, kpxcIcons.iconTypes.DEFAULT);
}
}
Expand Down
Loading