Skip to content

Commit 76d45f4

Browse files
committed
update
1 parent 1e8cb6a commit 76d45f4

1 file changed

Lines changed: 19 additions & 20 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListPage.java

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,25 @@ public void refresh() {
115115

116116
setLoading(true);
117117
Task.supplyAsync(Schedulers.io(), () -> {
118-
// Ensure the game version number is parsed
119-
profile.getRepository().getGameVersion(id);
120-
try (Stream<World> stream = World.getWorlds(savesDir)) {
121-
return stream.toList();
122-
}
123-
})
124-
.whenComplete(Schedulers.javafx(), (result, exception) -> {
125-
if (refreshCount != currentRefresh) {
126-
// A newer refresh task is running, discard this result
127-
return;
128-
}
129-
130-
worlds = result;
131-
updateWorldList();
132-
133-
if (exception != null)
134-
LOG.warning("Failed to load world list page", exception);
135-
136-
setLoading(false);
137-
}).start();
118+
// Ensure the game version number is parsed
119+
profile.getRepository().getGameVersion(id);
120+
try (Stream<World> stream = World.getWorlds(savesDir)) {
121+
return stream.toList();
122+
}
123+
}).whenComplete(Schedulers.javafx(), (result, exception) -> {
124+
if (refreshCount != currentRefresh) {
125+
// A newer refresh task is running, discard this result
126+
return;
127+
}
128+
129+
worlds = result;
130+
updateWorldList();
131+
132+
if (exception != null)
133+
LOG.warning("Failed to load world list page", exception);
134+
135+
setLoading(false);
136+
}).start();
138137
}
139138

140139
public void add() {

0 commit comments

Comments
 (0)