mirror of
https://github.com/OpenFusionProject/Client.git
synced 2024-11-13 02:10:04 +00:00
Revert readJsonSync() change for modifying servers
readJsonSync() apparently produces an immutable JSON, which made it to where you couldn't add or remove servers
This commit is contained in:
parent
b73329c6de
commit
cef8c1de93
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user