mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Make it so Advanced Search filter automatically prompts to select a filter if no filters defined already
Prevent crash when clearing a filter
This commit is contained in:
@@ -1063,17 +1063,18 @@ public class AdvancedSearch {
|
||||
control.setFilter(filter);
|
||||
if (filter != null) {
|
||||
control.getBtnFilter().setText(GuiBase.getInterface().encodeSymbols(filter.toString(), false));
|
||||
|
||||
if (filter.getOption() == FilterOption.CARD_KEYWORDS) {
|
||||
//the first time the user selects keywords, preload keywords for all cards
|
||||
Runnable preloadTask = Keyword.getPreloadTask();
|
||||
if (preloadTask != null) {
|
||||
GuiBase.getInterface().runBackgroundTask("Loading keywords...", preloadTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
control.getBtnFilter().setText(EMPTY_FILTER_TEXT);
|
||||
}
|
||||
if (filter.getOption() == FilterOption.CARD_KEYWORDS) {
|
||||
//the first time the user selects keywords, preload keywords for all cards
|
||||
Runnable preloadTask = Keyword.getPreloadTask();
|
||||
if (preloadTask != null) {
|
||||
GuiBase.getInterface().runBackgroundTask("Loading keywords...", preloadTask);
|
||||
}
|
||||
}
|
||||
if (onChange != null) {
|
||||
onChange.run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user