fixed an error during loading the list of yubikeys

This commit is contained in:
antelle 2020-05-26 23:26:26 +02:00
parent 701bb4caa4
commit 817b44b152
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
1 changed files with 9 additions and 7 deletions

View File

@ -21,13 +21,15 @@ class OpenChalRespView extends View {
YubiKey.list((err, yubiKeys) => {
this.error = err;
this.yubiKeys = [];
for (const { fullName, serial } of yubiKeys) {
for (const slot of [1, 2]) {
this.yubiKeys.push({
fullName,
serial,
slot
});
if (yubiKeys) {
for (const { fullName, serial } of yubiKeys) {
for (const slot of [1, 2]) {
this.yubiKeys.push({
fullName,
serial,
slot
});
}
}
}
this.render();