From d0958b793641dcbc9459d34a8ac03497a4f895b3 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 14 Apr 2023 13:26:29 -0600 Subject: [PATCH] clear border wallets selected cells on grid initialization --- .../com/sparrowwallet/sparrow/control/MnemonicGridDialog.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/MnemonicGridDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/MnemonicGridDialog.java index d3253074..f232f47d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/MnemonicGridDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/MnemonicGridDialog.java @@ -235,6 +235,7 @@ public class MnemonicGridDialog extends Dialog> { try(BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(file))) { String[][] wordGrid = PdfUtils.getWordGrid(inputStream); spreadsheetView.setGrid(getGrid(wordGrid)); + selectedCells.clear(); initializedProperty.set(true); } catch(Exception e) { AppServices.showErrorDialog("Cannot load PDF", e.getMessage()); @@ -255,6 +256,7 @@ public class MnemonicGridDialog extends Dialog> { List shuffledWordList = shuffle(mnemonicWords); String[][] wordGrid = toGrid(shuffledWordList); spreadsheetView.setGrid(getGrid(wordGrid)); + selectedCells.clear(); initializedProperty.set(true); if(seedEntryDialog.isGenerated()) { @@ -269,6 +271,7 @@ public class MnemonicGridDialog extends Dialog> { final ButtonBar.ButtonData buttonData = buttonType.getButtonData(); ButtonBar.setButtonData(clearButton, buttonData); clearButton.setOnAction(event -> { + selectedCells.clear(); spreadsheetView.getSelectionModel().clearSelection(); });