clear a scanned wallet when a file, text payload or unrecognised qr is imported in the same pane

This commit is contained in:
Craig Raw
2026-09-15 14:06:02 +02:00
parent 6cc4d50abd
commit d7ded1e7bb
@@ -127,6 +127,7 @@ public abstract class FileImportPane extends TitledDescriptionPane {
setExpanded(true);
} else {
try(InputStream inputStream = new BufferedInputStream(new FileInputStream(file))) {
wallets = null;
importFile(file.getName(), inputStream, password);
};
}
@@ -172,6 +173,7 @@ public abstract class FileImportPane extends TitledDescriptionPane {
}
} else if(result.payload != null) {
try {
wallets = null;
importFile(importer.getName(), new ByteArrayInputStream(result.payload.getBytes(StandardCharsets.UTF_8)), null);
} catch(Exception e) {
log.error("Error importing QR", e);
@@ -188,8 +190,8 @@ public abstract class FileImportPane extends TitledDescriptionPane {
log.error("Error importing QR", result.exception);
setError("Import Error", result.exception.getMessage());
} else {
setError("Import Error", null);
setExpanded(true);
wallets = null;
setError("Import Error", "The scanned QR code does not contain a wallet or key.");
}
}
}