mirror of https://github.com/keeweb/keeweb
fixed the yubikey challenge-response icon on the open screen
parent
1f862a37e9
commit
efa9b5f9a7
|
@ -111,6 +111,7 @@ class OpenView extends View {
|
|||
this.model.settings.canOpenOtpDevice &&
|
||||
this.model.settings.yubiKeyShowIcon &&
|
||||
!this.model.files.get('yubikey');
|
||||
const canUseChalRespYubiKey = hasYubiKeys && this.model.settings.yubiKeyShowChalResp;
|
||||
|
||||
super.render({
|
||||
lastOpenFiles: this.getLastOpenFiles(),
|
||||
|
@ -124,7 +125,7 @@ class OpenView extends View {
|
|||
canCreate: this.model.settings.canCreate,
|
||||
canRemoveLatest: this.model.settings.canRemoveLatest,
|
||||
canOpenYubiKey,
|
||||
hasYubiKeys,
|
||||
canUseChalRespYubiKey,
|
||||
showMore,
|
||||
showLogo
|
||||
});
|
||||
|
@ -990,13 +991,17 @@ class OpenView extends View {
|
|||
}
|
||||
|
||||
usbDevicesChanged() {
|
||||
if (this.model.settings.canOpenOtpDevice && this.model.settings.yubiKeyShowIcon) {
|
||||
if (this.model.settings.canOpenOtpDevice) {
|
||||
const hasYubiKeys = !!UsbListener.attachedYubiKeys.length;
|
||||
|
||||
this.$el.find('.open__icon-yubikey').toggleClass('hide', !hasYubiKeys);
|
||||
const showOpenIcon = hasYubiKeys && this.model.settings.yubiKeyShowIcon;
|
||||
this.$el.find('.open__icon-yubikey').toggleClass('hide', !showOpenIcon);
|
||||
|
||||
const showChallengeResponseIcon =
|
||||
hasYubiKeys && this.model.settings.yubiKeyShowChalResp;
|
||||
this.$el
|
||||
.find('.open__settings-yubikey')
|
||||
.toggleClass('open__settings-yubikey--present', hasYubiKeys);
|
||||
.toggleClass('open__settings-yubikey--present', !!showChallengeResponseIcon);
|
||||
|
||||
if (!hasYubiKeys && this.busy && this.otpDevice) {
|
||||
this.otpDevice.cancelOpen();
|
||||
|
|
|
@ -90,7 +90,8 @@
|
|||
</i><span class="open__settings-key-file-name">{{res 'openKeyFile'}}</span>
|
||||
{{#if canOpenKeyFromDropbox}}<span class="open__settings-key-file-dropbox"> {{res 'openKeyFileDropbox'}}</span>{{/if}}
|
||||
</div>
|
||||
<div class="open__settings-yubikey {{#if hasYubiKeys}}open__settings-yubikey--present{{/if}} hide" tabindex="26" title="YubiKey">
|
||||
<div class="open__settings-yubikey {{#if canUseChalRespYubiKey}}open__settings-yubikey--present{{/if}} hide"
|
||||
tabindex="26" title="YubiKey">
|
||||
{{{svg 'usb-token' 'open__settings-yubikey-img'}}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -26,16 +26,16 @@
|
|||
{{#if yubiKeyShowIcon}}checked{{/if}} />
|
||||
<label for="settings__yubikey-show-icon">{{res 'setDevicesYubiKeyOtpShowIcon'}}</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" class="settings__input input-base settings__yubikey-auto-open" id="settings__yubikey-auto-open"
|
||||
{{#if yubiKeyAutoOpen}}checked{{/if}} />
|
||||
<label for="settings__yubikey-auto-open">{{res 'setDevicesYubiKeyOtpAutoOpen'}}</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" class="settings__input input-base settings__yubikey-match-entries" id="settings__yubikey-match-entries"
|
||||
{{#if yubiKeyMatchEntries}}checked{{/if}} />
|
||||
<label for="settings__yubikey-match-entries">{{res 'setDevicesYubiKeyOtpMatchEntries'}}</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" class="settings__input input-base settings__yubikey-auto-open" id="settings__yubikey-auto-open"
|
||||
{{#if yubiKeyAutoOpen}}checked{{/if}} />
|
||||
<label for="settings__yubikey-auto-open">{{res 'setDevicesYubiKeyOtpAutoOpen'}}</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" class="settings__input input-base settings__yubikey-oath-workaround" id="settings__yubikey-oath-workaround"
|
||||
{{#if yubiKeyOathWorkaround}}checked{{/if}} />
|
||||
|
|
Loading…
Reference in New Issue