mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-05 05:46:44 +00:00
always show tapsigner in airgapped import options
This commit is contained in:
parent
fe4468d49d
commit
483e4c8f38
2 changed files with 9 additions and 6 deletions
|
@ -33,6 +33,8 @@ import javax.smartcardio.CardException;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
|
||||
import static com.sparrowwallet.sparrow.io.CardApi.isReaderAvailable;
|
||||
|
||||
public class CardImportPane extends TitledDescriptionPane {
|
||||
private static final Logger log = LoggerFactory.getLogger(CardImportPane.class);
|
||||
|
||||
|
@ -62,6 +64,12 @@ public class CardImportPane extends TitledDescriptionPane {
|
|||
}
|
||||
|
||||
private void importCard() {
|
||||
if(!isReaderAvailable()) {
|
||||
setError("No reader", "No card reader was detected.");
|
||||
importButton.setDisable(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if(pin.get().length() < 6) {
|
||||
setDescription(pin.get().isEmpty() ? "Enter PIN code" : "PIN code too short");
|
||||
setContent(getPinEntry());
|
||||
|
|
|
@ -15,8 +15,6 @@ import java.util.Collections;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import static com.sparrowwallet.sparrow.io.CardApi.isReaderAvailable;
|
||||
|
||||
public class HwAirgappedController extends KeystoreImportDetailController {
|
||||
private static final Logger log = LoggerFactory.getLogger(HwAirgappedController.class);
|
||||
|
||||
|
@ -40,10 +38,7 @@ public class HwAirgappedController extends KeystoreImportDetailController {
|
|||
}
|
||||
}
|
||||
|
||||
List<KeystoreCardImport> cardImporters = Collections.emptyList();
|
||||
if(isReaderAvailable()) {
|
||||
cardImporters = List.of(new Tapsigner());
|
||||
}
|
||||
List<KeystoreCardImport> cardImporters = List.of(new Tapsigner());
|
||||
for(KeystoreCardImport importer : cardImporters) {
|
||||
if(!importer.isDeprecated() || Config.get().isShowDeprecatedImportExport()) {
|
||||
CardImportPane importPane = new CardImportPane(getMasterController().getWallet(), importer, getMasterController().getRequiredDerivation());
|
||||
|
|
Loading…
Reference in a new issue