mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-02-17 17:09:55 +08:00
Fix not on ui thread
This commit is contained in:
parent
6ac32a40c7
commit
a385265956
@ -24,6 +24,7 @@ import javafx.scene.control.Skin;
|
||||
import javafx.scene.control.TreeItem;
|
||||
import javafx.stage.FileChooser;
|
||||
import org.jackhuang.hmcl.mod.Datapack;
|
||||
import org.jackhuang.hmcl.task.Schedulers;
|
||||
import org.jackhuang.hmcl.task.Task;
|
||||
import org.jackhuang.hmcl.ui.Controllers;
|
||||
import org.jackhuang.hmcl.ui.FXUtils;
|
||||
@ -80,7 +81,7 @@ public class DatapackListPage extends ListPageBase<DatapackListPageSkin.Datapack
|
||||
public void refresh() {
|
||||
setLoading(true);
|
||||
Task.of(datapack::loadFromDir)
|
||||
.with(Task.of(() -> setLoading(false)))
|
||||
.with(Task.of(Schedulers.javafx(), () -> setLoading(false)))
|
||||
.start();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user