Fix U2F error reasons always hidden (#16327)

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>
release/v1.15
Stephen Holdaway 2021-07-03 20:19:38 +12:00 committed by GitHub
parent a9ba29b1cd
commit f166f9b2e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2421,7 +2421,7 @@ function u2fError(errorType) {
u2fErrors[errorType].removeClass('hide'); u2fErrors[errorType].removeClass('hide');
Object.keys(u2fErrors).forEach((type) => { Object.keys(u2fErrors).forEach((type) => {
if (type !== errorType) { if (type !== `${errorType}`) {
u2fErrors[type].addClass('hide'); u2fErrors[type].addClass('hide');
} }
}); });