Skip to content

Commit

Permalink
Run name/selection popup actions async
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Sep 26, 2023
1 parent 7fa9056 commit d132520
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import software.coley.recaf.workspace.model.bundle.FileBundle;

import java.awt.*;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;

import static atlantafx.base.theme.Styles.*;
Expand Down Expand Up @@ -87,7 +88,8 @@ private void accept(@Nonnull Consumer<String> nameConsumer) {
return;
}

nameConsumer.accept(nameInput.getText());
String text = nameInput.getText();
CompletableFuture.runAsync(() -> nameConsumer.accept(text));
hide();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import software.coley.recaf.ui.window.RecafStage;

import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Function;

Expand Down Expand Up @@ -70,7 +71,7 @@ protected void accept(@Nonnull Consumer<List<T>> consumer) {
* Action to run on accept.
*/
private void accept(@Nonnull List<T> selectedItems, @Nonnull Consumer<List<T>> consumer) {
consumer.accept(selectedItems);
CompletableFuture.runAsync(() -> consumer.accept(selectedItems));
hide();
}

Expand Down

0 comments on commit d132520

Please sign in to comment.