fix(download): cannot refresh mod download list. Mentioned in #1203.

This commit is contained in:
huanghongxun
2021-12-19 19:47:55 +08:00
parent ad5b260460
commit 3192d41fe3

View File

@@ -84,7 +84,12 @@ public class DownloadPage extends Control implements DecoratorPage {
this.mod = ModTranslations.getModByCurseForgeId(addon.getSlug());
this.version = version;
this.callback = callback;
loadModVersions();
this.state.set(State.fromTitle(addon.getTitle()));
}
private void loadModVersions() {
File versionJar = StringUtils.isNotBlank(version.getVersion())
? version.getProfile().getRepository().getVersionJar(version.getVersion())
: null;
@@ -122,8 +127,6 @@ public class DownloadPage extends Control implements DecoratorPage {
}
setLoading(false);
}).start();
this.state.set(State.fromTitle(addon.getTitle()));
}
private SimpleMultimap<String, RemoteMod.Version> sortVersions(Stream<RemoteMod.Version> versions) {
@@ -297,6 +300,7 @@ public class DownloadPage extends Control implements DecoratorPage {
return null;
}
}, getSkinnable().failedProperty()));
spinnerPane.setOnFailedAction(e -> getSkinnable().loadModVersions());
ComponentList list = new ComponentList();
StackPane.setAlignment(list, Pos.TOP_CENTER);