Skip to content
This repository was archived by the owner on Dec 27, 2025. It is now read-only.

Commit c3ce3d2

Browse files
committed
Refactor Frame disposal to use SwingUtilities.invokeLater and update Updater to handle latest version notification
1 parent c891093 commit c3ce3d2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/main/java/fr/sandro642/orbit/update/core/Updater.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ public void checkForUpdates() {
4141
if (isLatestVersion()) {
4242
downloadFile("https://raw.githubusercontent.com/Sandro642/sandro642.github.io/main/orbit/jar/fr/sandro642/orbit/Orbit/" + fetchVersion() + "/Orbit-" + fetchVersion() + "-fat.jar", FolderParent.toString() + "/Orbit-" + fetchVersion() + ".jar");
4343
removeAndStartNewVersion();
44-
} else {
45-
Orbit.getInstance().getFrame().kill();
4644
}
4745

4846
} catch (Exception exception) {
@@ -97,7 +95,12 @@ private boolean isLatestVersion() {
9795
} else {
9896
Orbit.getInstance().getLogger().INFO(ORBIT + "You are using the latest version: " + Version.VERSION);
9997

100-
return false;
98+
Orbit.getInstance().getFrame().textComponent("Vous utilisez la dernière version.");
99+
Orbit.getInstance().getFrame().ProgressValue(5);
100+
Thread.sleep(1000);
101+
Orbit.getInstance().getFrame().textComponent("Lancement de Orbit...");
102+
103+
Orbit.getInstance().getFrame().kill();
101104
}
102105

103106
} catch (Exception exception) {

src/main/java/fr/sandro642/orbit/update/ui/Frame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void init() {
119119
}
120120

121121
public void kill() {
122-
dispose();
122+
SwingUtilities.invokeLater(this::dispose);
123123
}
124124

125125
public static Frame getFrameSingleton() {

0 commit comments

Comments
 (0)