Skip to content

Commit

Permalink
[ikonli-browser] Clear previous ikons when searching
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed May 2, 2021
1 parent 17d7aa2 commit 8f1aa8a
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ public void onChanged(Change<? extends Ikon> c) {
while (c.next()) {
if (c.wasAdded()) {
addIcons(new ArrayList<>(c.getAddedSubList()), grid);
} else if (c.wasRemoved()) {
// can only happen when we clear the list
if (Platform.isFxApplicationThread()) {
grid.getChildren().clear();
} else {
Platform.runLater(() -> grid.getChildren().clear());
}
}
}
}
Expand Down Expand Up @@ -324,6 +331,8 @@ public Controller(Model model) {
}

public void search() {
model.getIkons().clear();

if (executor == null) {
executor = Executors.newSingleThreadExecutor();
}
Expand Down

0 comments on commit 8f1aa8a

Please sign in to comment.