обработка данных

This commit is contained in:
Dmitry Borisenko
2022-01-19 23:03:26 +01:00
parent 7ff008b383
commit 40acb5570f

View File

@@ -190,6 +190,7 @@
//navigation //navigation
let currentPageName = undefined; let currentPageName = undefined;
let dataReceivingInProgress = false;
router.subscribe(handleNavigation); router.subscribe(handleNavigation);
//****************************************************functions section********************************************************/ //****************************************************functions section********************************************************/
@@ -286,6 +287,7 @@
addCoreMsg(data); addCoreMsg(data);
//if (debug) console.log("[i]", "log data:", data); //if (debug) console.log("[i]", "log data:", data);
} else if (data.includes("/config.json")) { } else if (data.includes("/config.json")) {
dataReceivingInProgress = true;
data = data.replace("/config.json", ""); data = data.replace("/config.json", "");
configJsonBuf = configJsonBuf + data; configJsonBuf = configJsonBuf + data;
if (data.includes("]}")) { if (data.includes("]}")) {
@@ -294,10 +296,12 @@
configJson = JSON.parse(configJsonBuf); configJson = JSON.parse(configJsonBuf);
configJsonBuf = []; configJsonBuf = [];
configJson = configJson; configJson = configJson;
dataReceivingInProgress = false;
if (debug) console.log("[i]", "configJson parsed"); if (debug) console.log("[i]", "configJson parsed");
} }
} }
} else if (data.includes("/widgets.json")) { } else if (data.includes("/widgets.json")) {
dataReceivingInProgress = true;
data = data.replace("/widgets.json", ""); data = data.replace("/widgets.json", "");
widgetCollectionBuf = widgetCollectionBuf + data; widgetCollectionBuf = widgetCollectionBuf + data;
if (data.includes("]}")) { if (data.includes("]}")) {
@@ -306,6 +310,7 @@
widgetCollection = JSON.parse(widgetCollectionBuf); widgetCollection = JSON.parse(widgetCollectionBuf);
widgetCollectionBuf = []; widgetCollectionBuf = [];
widgetCollection = widgetCollection; widgetCollection = widgetCollection;
dataReceivingInProgress = false;
if (debug) console.log("[i]", "widgetCollection parsed"); if (debug) console.log("[i]", "widgetCollection parsed");
} }
} }