mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-09 03:46:18 -04:00
fix(download): cannot refresh game list. Mentioned in #1203.
This commit is contained in:
parent
e57cb0ce51
commit
ad5b260460
@ -88,6 +88,8 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP
|
|||||||
private TaskExecutor executor;
|
private TaskExecutor executor;
|
||||||
protected RemoteModRepository repository;
|
protected RemoteModRepository repository;
|
||||||
|
|
||||||
|
private Runnable retrySearch;
|
||||||
|
|
||||||
public DownloadListPage(RemoteModRepository repository) {
|
public DownloadListPage(RemoteModRepository repository) {
|
||||||
this(repository, null);
|
this(repository, null);
|
||||||
}
|
}
|
||||||
@ -151,6 +153,7 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void search(String userGameVersion, RemoteModRepository.Category category, int pageOffset, String searchFilter, int sort) {
|
public void search(String userGameVersion, RemoteModRepository.Category category, int pageOffset, String searchFilter, int sort) {
|
||||||
|
retrySearch = null;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setFailed(false);
|
setFailed(false);
|
||||||
File versionJar = StringUtils.isNotBlank(version.get().getVersion())
|
File versionJar = StringUtils.isNotBlank(version.get().getVersion())
|
||||||
@ -177,6 +180,7 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP
|
|||||||
failed.set(false);
|
failed.set(false);
|
||||||
} else {
|
} else {
|
||||||
failed.set(true);
|
failed.set(true);
|
||||||
|
retrySearch = () -> search(userGameVersion, category, pageOffset, searchFilter, sort);
|
||||||
}
|
}
|
||||||
}).executor(true);
|
}).executor(true);
|
||||||
}
|
}
|
||||||
@ -360,6 +364,11 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, getSkinnable().failedProperty()));
|
}, getSkinnable().failedProperty()));
|
||||||
|
spinnerPane.setOnFailedAction(e -> {
|
||||||
|
if (getSkinnable().retrySearch != null) {
|
||||||
|
getSkinnable().retrySearch.run();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
JFXListView<RemoteMod> listView = new JFXListView<>();
|
JFXListView<RemoteMod> listView = new JFXListView<>();
|
||||||
spinnerPane.setContent(listView);
|
spinnerPane.setContent(listView);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user