diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java index 8abbec4b4..5469889d0 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java @@ -120,11 +120,10 @@ public final class LeftPaneController extends AdvancedListBox { if (modpackFile.exists()) { Task.ofResult(() -> CompressingUtils.findSuitableEncoding(modpackFile.toPath())) .thenApply(encoding -> ModpackHelper.readModpackManifest(modpackFile.toPath(), encoding)) - .thenAccept(modpack -> { - AtomicReference region = new AtomicReference<>(); - TaskExecutor executor = ModpackHelper.getInstallTask(repository.getProfile(), modpackFile, modpack.getName(), modpack) - .with(Task.of(Schedulers.javafx(), this::checkAccount)).executor(); - region.set(Controllers.taskDialog(executor, i18n("modpack.installing"))); + .thenApply(modpack -> ModpackHelper.getInstallTask(repository.getProfile(), modpackFile, modpack.getName(), modpack) + .with(Task.of(Schedulers.javafx(), this::checkAccount)).executor()) + .thenAccept(Schedulers.javafx(), executor -> { + Controllers.taskDialog(executor, i18n("modpack.installing")); executor.start(); }).start(); }