Fix #3445: 点击安装整合包时无条件关闭整合包下载对话框 (#3621)

This commit is contained in:
Glavo
2025-02-17 23:35:58 +08:00
committed by GitHub
parent c2abe755f4
commit 554ecfd6d5

View File

@@ -305,7 +305,7 @@ public class DownloadPage extends Control implements DecoratorPage {
ComponentList sublist = new ComponentList(() -> { ComponentList sublist = new ComponentList(() -> {
ArrayList<ModItem> items = new ArrayList<>(versions.size()); ArrayList<ModItem> items = new ArrayList<>(versions.size());
for (RemoteMod.Version v: versions) { for (RemoteMod.Version v : versions) {
items.add(new ModItem(v, control)); items.add(new ModItem(v, control));
} }
return items; return items;
@@ -466,7 +466,7 @@ public class DownloadPage extends Control implements DecoratorPage {
JFXButton downloadButton = new JFXButton(isModpack ? i18n("install.modpack") : i18n("mods.install")); JFXButton downloadButton = new JFXButton(isModpack ? i18n("install.modpack") : i18n("mods.install"));
downloadButton.getStyleClass().add("dialog-accept"); downloadButton.getStyleClass().add("dialog-accept");
downloadButton.setOnAction(e -> { downloadButton.setOnAction(e -> {
if (!spinnerPane.isLoading() && spinnerPane.getFailedReason() == null) { if (isModpack || !spinnerPane.isLoading() && spinnerPane.getFailedReason() == null) {
fireEvent(new DialogCloseEvent()); fireEvent(new DialogCloseEvent());
} }
selfPage.download(version); selfPage.download(version);