From e933bc52fe0ea74ff6f8583d371585a6e1d4877e Mon Sep 17 00:00:00 2001 From: FinnHornhoover Date: Sat, 18 Nov 2023 00:47:23 +0300 Subject: [PATCH] fixed added versions not showing up immediately --- assets/js/server-selector.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/js/server-selector.js b/assets/js/server-selector.js index 1ff8994..06786c4 100644 --- a/assets/js/server-selector.js +++ b/assets/js/server-selector.js @@ -331,6 +331,10 @@ function validateCacheLocation() { function loadGameVersions() { var versionJson = remotefs.readJsonSync(versionsPath); versionArray = versionJson["versions"]; + + $("#addserver-versionselect").empty(); + $("#editserver-versionselect").empty(); + $.each(versionArray, function (key, value) { $(new Option(value.name, "val")).appendTo("#addserver-versionselect"); $(new Option(value.name, "val")).appendTo("#editserver-versionselect"); @@ -384,8 +388,8 @@ function loadServerList() { } function loadCacheList() { - var versionjson = remotefs.readJsonSync(versionsPath); - versionArray = versionjson["versions"]; + // we might want to use a new version right away, so reload them + loadGameVersions(); if (!defaultHashes) { defaultHashes = remotefs.readJsonSync(path.join(