Merge pull request #844 from keepassxreboot/fix/totp_maxlength_comparison

Fix TOTP field maxLength comparison & do not override TOTP icon
This commit is contained in:
Sami Vänttinen 2020-04-11 11:04:19 +03:00 committed by GitHub
commit ca2d4fd7b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -34,7 +34,7 @@ TOTPFieldIcon.prototype.initField = function(field) {
|| field.getAttribute('kpxc-totp-field') === 'true'
|| field.offsetWidth < MINIMUM_SIZE
|| field.size < 2
|| (field.maxLength > 0 && field.maxLength < 4)
|| (field.maxLength > 0 && (field.maxLength < 6 || field.maxLength > 8))
|| field.id.match(ignoreRegex)
|| field.name.match(ignoreRegex)) {
return;

View file

@ -41,7 +41,10 @@ class UsernameFieldIcon extends Icon {
}
UsernameFieldIcon.prototype.initField = function(field) {
if (!field || field.getAttribute('kpxc-username-field') === 'true' || !kpxcFields.isVisible(field)) {
if (!field
|| field.getAttribute('kpxc-username-field') === 'true'
|| field.getAttribute('kpxc-totp-field') === 'true'
|| !kpxcFields.isVisible(field)) {
return;
}