@@ -74,7 +74,6 @@ public final class VersionsPage extends Control implements WizardPage, Refreshab
|
|||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
private final VersionList<?> versionList;
|
private final VersionList<?> versionList;
|
||||||
private final Runnable callback;
|
private final Runnable callback;
|
||||||
private Task<?> task;
|
|
||||||
|
|
||||||
private final ObservableList<RemoteVersion> versions = FXCollections.observableArrayList();
|
private final ObservableList<RemoteVersion> versions = FXCollections.observableArrayList();
|
||||||
private final ObjectProperty<Status> status = new SimpleObjectProperty<>(Status.LOADING);
|
private final ObjectProperty<Status> status = new SimpleObjectProperty<>(Status.LOADING);
|
||||||
@@ -98,7 +97,7 @@ public final class VersionsPage extends Control implements WizardPage, Refreshab
|
|||||||
@Override
|
@Override
|
||||||
public void refresh() {
|
public void refresh() {
|
||||||
status.set(Status.LOADING);
|
status.set(Status.LOADING);
|
||||||
task = versionList.refreshAsync(gameVersion)
|
Task<?> task = versionList.refreshAsync(gameVersion)
|
||||||
.thenSupplyAsync(() -> versionList.getVersions(gameVersion).stream().sorted().collect(Collectors.toList()))
|
.thenSupplyAsync(() -> versionList.getVersions(gameVersion).stream().sorted().collect(Collectors.toList()))
|
||||||
.whenComplete(Schedulers.javafx(), (items, exception) -> {
|
.whenComplete(Schedulers.javafx(), (items, exception) -> {
|
||||||
if (exception == null) {
|
if (exception == null) {
|
||||||
@@ -120,8 +119,6 @@ public final class VersionsPage extends Control implements WizardPage, Refreshab
|
|||||||
@Override
|
@Override
|
||||||
public void cleanup(Map<String, Object> settings) {
|
public void cleanup(Map<String, Object> settings) {
|
||||||
settings.remove(libraryId);
|
settings.remove(libraryId);
|
||||||
if (task != null)
|
|
||||||
task.executor().cancel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onRefresh() {
|
private void onRefresh() {
|
||||||
|
|||||||
Reference in New Issue
Block a user