Trying more

This commit is contained in:
Falkvinge
2017-03-16 10:00:38 +01:00
parent 30f7a62c6e
commit 5258988ad8
2 changed files with 10 additions and 3 deletions
+5
View File
@@ -231,6 +231,11 @@ namespace Swarmops.Frontend.Socket
malfunctionsArray.Add(malfunctionObject);
}
if (++_malfunctionTestCounter > 4)
{
_malfunctionTestCounter = 0;
}
JObject data2 = new JObject();
data2["MessageType"] = "Malfunctions";
data2["MalfunctionsList"] = malfunctionsArray.ToString();
+5 -3
View File
@@ -86,9 +86,11 @@ function updateListBox(box, listData) {
// Step 1: Iterate through list, build id array
var idListLookup = {};
listData.forEach(function(item, index) {
idListLookup[item.id] = item;
});
if (listData.length > 0) {
listData.forEach(function(item, index) {
idListLookup[item.id] = item;
});
}
// Step 2: Iterate through box, change texts of matching ids,
// remove items that aren't in list, build id array