Skip to content

Commit 145adaf

Browse files
committed
Fix working directory not updating version in GUI
1 parent 7bb7f7c commit 145adaf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gui/src/main/java/org/mcphackers/mcp/main/MainGUI.java

+8
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,14 @@ public void changeWorkingDirectory() {
280280
this.options.workingDir = p;
281281
this.options.save();
282282
VersionParser versionParser = VersionParser.getInstance();
283+
Path versionPath = MCPPaths.get(this, MCPPaths.VERSION);
284+
if (Files.exists(versionPath)) {
285+
try {
286+
currentVersion = Version.from(new JSONObject(new String(Files.readAllBytes(versionPath))));
287+
} catch (JSONException | IOException e) {
288+
e.printStackTrace();
289+
}
290+
}
283291
this.frame.setCurrentVersion(this.currentVersion == null ? null : versionParser.getVersion(this.currentVersion.id));
284292
this.frame.reloadText();
285293
this.frame.reloadVersionList();

0 commit comments

Comments
 (0)