mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Code cleanup
This commit is contained in:
parent
5a0e211e19
commit
b7739344d4
1 changed files with 14 additions and 10 deletions
|
|
@ -108,16 +108,8 @@ class TOTPFieldIcon extends Icon {
|
|||
}
|
||||
}
|
||||
|
||||
TOTPFieldIcon.prototype.initField = async function(field, segmented) {
|
||||
// Observer the visibility
|
||||
if (this.observer) {
|
||||
this.observer.observe(field);
|
||||
}
|
||||
|
||||
this.createIcon(field, segmented);
|
||||
this.inputField = field;
|
||||
|
||||
// Fill TOTP automatically if option is enabled
|
||||
// Fill TOTP automatically if option is enabled
|
||||
TOTPFieldIcon.prototype.autoFillSingleTotp = async function(field) {
|
||||
if (kpxc.settings.autoFillSingleTotp) {
|
||||
if (kpxc.credentials.length === 0) {
|
||||
await kpxc.receiveCredentialsIfNecessary();
|
||||
|
|
@ -129,6 +121,18 @@ TOTPFieldIcon.prototype.initField = async function(field, segmented) {
|
|||
}
|
||||
};
|
||||
|
||||
TOTPFieldIcon.prototype.initField = async function(field, segmented) {
|
||||
// Observer the visibility
|
||||
if (this.observer) {
|
||||
this.observer.observe(field);
|
||||
}
|
||||
|
||||
this.createIcon(field, segmented);
|
||||
this.inputField = field;
|
||||
|
||||
await this.autoFillSingleTotp(field);
|
||||
};
|
||||
|
||||
TOTPFieldIcon.prototype.createIcon = function(field, segmented = false) {
|
||||
const className = (isFirefox() ? 'moz' : 'default');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue