mirror of
https://github.com/OpenFusionProject/Client.git
synced 2024-11-22 13:40:06 +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() {
|
function addServer() {
|
||||||
var jsonToModify = remotefs.readJsonSync(serversPath);
|
var jsonToModify = JSON.parse(remotefs.readFileSync(serversPath));
|
||||||
|
|
||||||
var server = {};
|
var server = {};
|
||||||
server["uuid"] = uuidv4();
|
server["uuid"] = uuidv4();
|
||||||
@ -70,7 +70,7 @@ function addServer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function editServer() {
|
function editServer() {
|
||||||
var jsonToModify = remotefs.readJsonSync(serversPath);
|
var jsonToModify = JSON.parse(remotefs.readFileSync(serversPath));
|
||||||
$.each(jsonToModify["servers"], function (key, value) {
|
$.each(jsonToModify["servers"], function (key, value) {
|
||||||
if (value["uuid"] == getSelectedServer()) {
|
if (value["uuid"] == getSelectedServer()) {
|
||||||
value["description"] =
|
value["description"] =
|
||||||
@ -92,7 +92,7 @@ function editServer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function deleteServer() {
|
function deleteServer() {
|
||||||
var jsonToModify = remotefs.readJsonSync(serversPath);
|
var jsonToModify = JSON.parse(remotefs.readFileSync(serversPath));
|
||||||
var result = jsonToModify["servers"].filter(function (obj) {
|
var result = jsonToModify["servers"].filter(function (obj) {
|
||||||
return obj.uuid === getSelectedServer();
|
return obj.uuid === getSelectedServer();
|
||||||
})[0];
|
})[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user