From c034dbe89e177261f6beae568d1b7e3624fdd112 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 6 Mar 2024 14:11:37 +0200 Subject: [PATCH] better handling of multiple verification file drop --- .../sparrowwallet/sparrow/AppController.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index ef02d738..addf4139 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -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); @@ -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 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); + } } }