Fix filling TOTP to fields not in combinations

This commit is contained in:
varjolintu 2022-03-17 10:49:49 +02:00
parent 6ab3299faf
commit bfb309963a

View file

@ -16,7 +16,7 @@ TOTPAutocomplete.prototype.itemClick = async function(e, input, uuid) {
}
const index = Array.prototype.indexOf.call(e.currentTarget.parentElement.childNodes, e.currentTarget);
this.fillTotp(index, uuid);
await this.fillTotp(index, uuid, input);
this.closeList();
input.focus();
@ -26,11 +26,14 @@ TOTPAutocomplete.prototype.itemEnter = async function(index, elements) {
this.fillTotp(index, elements[index].uuid);
};
TOTPAutocomplete.prototype.fillTotp = async function(index, uuid) {
TOTPAutocomplete.prototype.fillTotp = async function(index, uuid, currentInput) {
const combination = await kpxcFields.getCombination(this.input, 'totp')
|| await kpxcFields.getCombination(this.input, 'totpInputs');
combination.loginId = index;
kpxcFill.fillTOTPFromUuid(this.input, uuid);
if (combination) {
combination.loginId = index;
}
kpxcFill.fillTOTPFromUuid(this.input || currentInput, uuid);
};
const kpxcTOTPAutocomplete = new TOTPAutocomplete();