From cef8c1de93cba13065bbf655efd1db2e9524ce3b Mon Sep 17 00:00:00 2001 From: CakeLancelot Date: Wed, 18 Oct 2023 12:47:41 -0500 Subject: [PATCH] Revert readJsonSync() change for modifying servers readJsonSync() apparently produces an immutable JSON, which made it to where you couldn't add or remove servers --- assets/js/server-selector.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/server-selector.js b/assets/js/server-selector.js index 9c39c73..0017c61 100644 --- a/assets/js/server-selector.js +++ b/assets/js/server-selector.js @@ -48,7 +48,7 @@ function setAppVersionText() { } function addServer() { - var jsonToModify = remotefs.readJsonSync(serversPath); + var jsonToModify = JSON.parse(remotefs.readFileSync(serversPath)); var server = {}; server["uuid"] = uuidv4(); @@ -70,7 +70,7 @@ function addServer() { } function editServer() { - var jsonToModify = remotefs.readJsonSync(serversPath); + var jsonToModify = JSON.parse(remotefs.readFileSync(serversPath)); $.each(jsonToModify["servers"], function (key, value) { if (value["uuid"] == getSelectedServer()) { value["description"] = @@ -92,7 +92,7 @@ function editServer() { } function deleteServer() { - var jsonToModify = remotefs.readJsonSync(serversPath); + var jsonToModify = JSON.parse(remotefs.readFileSync(serversPath)); var result = jsonToModify["servers"].filter(function (obj) { return obj.uuid === getSelectedServer(); })[0];