mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-16 07:16:27 -04:00
fix(ui): crash when duplicating game version.
This commit is contained in:
parent
877c5a827c
commit
935436ce49
@ -141,8 +141,8 @@ public final class Versions {
|
|||||||
public static void duplicateVersion(Profile profile, String version) {
|
public static void duplicateVersion(Profile profile, String version) {
|
||||||
Controllers.prompt(
|
Controllers.prompt(
|
||||||
new PromptDialogPane.Builder(i18n("version.manage.duplicate.prompt"), (res, resolve, reject) -> {
|
new PromptDialogPane.Builder(i18n("version.manage.duplicate.prompt"), (res, resolve, reject) -> {
|
||||||
String newVersionName = ((PromptDialogPane.Builder.StringQuestion) res.get(0)).getValue();
|
String newVersionName = ((PromptDialogPane.Builder.StringQuestion) res.get(1)).getValue();
|
||||||
boolean copySaves = ((PromptDialogPane.Builder.BooleanQuestion) res.get(1)).getValue();
|
boolean copySaves = ((PromptDialogPane.Builder.BooleanQuestion) res.get(2)).getValue();
|
||||||
Task.runAsync(() -> profile.getRepository().duplicateVersion(version, newVersionName, copySaves))
|
Task.runAsync(() -> profile.getRepository().duplicateVersion(version, newVersionName, copySaves))
|
||||||
.thenComposeAsync(profile.getRepository().refreshVersionsAsync())
|
.thenComposeAsync(profile.getRepository().refreshVersionsAsync())
|
||||||
.whenComplete(Schedulers.javafx(), (result, exception) -> {
|
.whenComplete(Schedulers.javafx(), (result, exception) -> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user