From 6ef04d2fa5b6f67d2bef1586ac4efc2c92d17a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+CiiLu@users.noreply.github.com> Date: Fri, 17 Apr 2026 22:12:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E7=A6=81=E6=AD=A2=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E7=9A=84=E6=93=8D=E4=BD=9C=E7=A6=81=E7=94=A8=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=8C=89=E9=92=AE=20(#5948)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmcl/ui/construct/TaskExecutorDialogPane.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java index f2a4e9ff7d..6f198f6842 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java @@ -81,12 +81,11 @@ public class TaskExecutorDialogPane extends BorderPane { setCancel(cancel); + btnCancel.setDisable(onCancel.getCancellationAction() == null); btnCancel.setOnAction(e -> { - if (onCancel.getCancellationAction() != null) { - if (executor != null) - executor.cancel(); - onCancel.getCancellationAction().accept(this); - } + if (executor != null) + executor.cancel(); + onCancel.getCancellationAction().accept(this); }); speedEventHandler = FetchTask.SPEED_EVENT.registerWeak(speedEvent -> {