Skip to content

Commit

Permalink
Fix U2F error reasons always hidden (#16327)
Browse files Browse the repository at this point in the history
This strict equality check in `u2fError` was causing the error
description to hide immediately after showing. `Object.keys`
always returns strings, but `errorType` argument is usually a
number type.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
  • Loading branch information
3 people authored Jul 3, 2021
1 parent a9ba29b commit f166f9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2421,7 +2421,7 @@ function u2fError(errorType) {
u2fErrors[errorType].removeClass('hide');

Object.keys(u2fErrors).forEach((type) => {
if (type !== errorType) {
if (type !== `${errorType}`) {
u2fErrors[type].addClass('hide');
}
});
Expand Down

0 comments on commit f166f9b

Please sign in to comment.