Skip to content

Commit

Permalink
better handling of multiple verification file drop
Browse files Browse the repository at this point in the history
  • Loading branch information
craigraw committed Mar 6, 2024
1 parent 4cb2e1e commit c034dbe
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/main/java/com/sparrowwallet/sparrow/AppController.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,7 @@ void initializeView() {
Dragboard db = event.getDragboard();
boolean success = false;
if(db.hasFiles()) {
for(File file : db.getFiles()) {
openFile(file);
}
openFiles(db.getFiles());
success = true;
}
event.setDropCompleted(success);
Expand Down Expand Up @@ -998,13 +996,19 @@ public void restart(ActionEvent event, Network network) {
}
}

public void openFile(File file) {
if(isWalletFile(file)) {
openWalletFile(file, true);
} else if(isVerifyDownloadFile(file)) {
verifyDownload(new ActionEvent(file, rootStack));
} else {
openTransactionFile(file);
public void openFiles(List<File> files) {
boolean verifyOpened = false;
for(File file : files) {
if(isWalletFile(file)) {
openWalletFile(file, true);
} else if(isVerifyDownloadFile(file)) {
if(!verifyOpened) {
verifyDownload(new ActionEvent(file, rootStack));
verifyOpened = true;
}
} else {
openTransactionFile(file);
}
}
}

Expand Down

0 comments on commit c034dbe

Please sign in to comment.