mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-16 07:16:27 -04:00
Force refreshing version list when remove version from disk
This commit is contained in:
parent
c209617ee7
commit
1956ba7a73
@ -50,9 +50,7 @@ public class Versions {
|
||||
isMovingToTrashSupported ? i18n("version.manage.remove.confirm.trash", version, version + "_removed") :
|
||||
i18n("version.manage.remove.confirm", version);
|
||||
Controllers.confirmDialog(message, i18n("message.confirm"), () -> {
|
||||
if (profile.getRepository().removeVersionFromDisk(version)) {
|
||||
profile.getRepository().refreshVersionsAsync().start();
|
||||
}
|
||||
profile.getRepository().removeVersionFromDisk(version);
|
||||
}, null);
|
||||
}
|
||||
|
||||
|
@ -166,6 +166,7 @@ public class DefaultGameRepository implements GameRepository {
|
||||
if (!file.renameTo(removedFile))
|
||||
return false;
|
||||
|
||||
try {
|
||||
versions.remove(id);
|
||||
|
||||
if (FileUtils.isMovingToTrashSupported() && FileUtils.moveToTrash(removedFile)) {
|
||||
@ -185,6 +186,9 @@ public class DefaultGameRepository implements GameRepository {
|
||||
LOG.log(Level.WARNING, "Unable to remove version folder: " + file, e);
|
||||
}
|
||||
return true;
|
||||
} finally {
|
||||
refreshVersionsAsync().start();
|
||||
}
|
||||
}
|
||||
|
||||
protected void refreshVersionsImpl() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user