Fix potential "not on UI thread" exception
This commit is contained in:
@@ -120,11 +120,10 @@ public final class LeftPaneController extends AdvancedListBox {
|
|||||||
if (modpackFile.exists()) {
|
if (modpackFile.exists()) {
|
||||||
Task.ofResult(() -> CompressingUtils.findSuitableEncoding(modpackFile.toPath()))
|
Task.ofResult(() -> CompressingUtils.findSuitableEncoding(modpackFile.toPath()))
|
||||||
.thenApply(encoding -> ModpackHelper.readModpackManifest(modpackFile.toPath(), encoding))
|
.thenApply(encoding -> ModpackHelper.readModpackManifest(modpackFile.toPath(), encoding))
|
||||||
.thenAccept(modpack -> {
|
.thenApply(modpack -> ModpackHelper.getInstallTask(repository.getProfile(), modpackFile, modpack.getName(), modpack)
|
||||||
AtomicReference<Region> region = new AtomicReference<>();
|
.with(Task.of(Schedulers.javafx(), this::checkAccount)).executor())
|
||||||
TaskExecutor executor = ModpackHelper.getInstallTask(repository.getProfile(), modpackFile, modpack.getName(), modpack)
|
.thenAccept(Schedulers.javafx(), executor -> {
|
||||||
.with(Task.of(Schedulers.javafx(), this::checkAccount)).executor();
|
Controllers.taskDialog(executor, i18n("modpack.installing"));
|
||||||
region.set(Controllers.taskDialog(executor, i18n("modpack.installing")));
|
|
||||||
executor.start();
|
executor.start();
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user