From 4fecc1e58f73d466e57609f9c1735308aaea7af2 Mon Sep 17 00:00:00 2001 From: crschnick Date: Sun, 24 Dec 2023 18:17:14 +0000 Subject: [PATCH] Check entry status while scanning --- app/src/main/java/io/xpipe/app/util/ScanAlert.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/util/ScanAlert.java b/app/src/main/java/io/xpipe/app/util/ScanAlert.java index 95520bdb3..daeaa9192 100644 --- a/app/src/main/java/io/xpipe/app/util/ScanAlert.java +++ b/app/src/main/java/io/xpipe/app/util/ScanAlert.java @@ -11,6 +11,7 @@ import io.xpipe.app.fxcomps.CompStructure; import io.xpipe.app.fxcomps.SimpleCompStructure; import io.xpipe.app.fxcomps.impl.DataStoreChoiceComp; import io.xpipe.app.issue.ErrorEvent; +import io.xpipe.app.storage.DataStorage; import io.xpipe.app.storage.DataStoreEntry; import io.xpipe.app.storage.DataStoreEntryRef; import io.xpipe.core.store.ShellStore; @@ -138,7 +139,6 @@ public class ScanAlert { return; } - Platform.runLater(() -> { window.close(); }); @@ -148,6 +148,12 @@ public class ScanAlert { var copy = new ArrayList<>(selected); for (var a : copy) { + // If the user decided to remove the selected entry + // while the scan is running, just return instantly + if (!DataStorage.get().getStoreEntriesSet().contains(entry.get().get())) { + return; + } + try { a.getScanner().run(); } catch (Exception ex) {