1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-09 19:53:33 +00:00

Fixed repos not being displayed (fixes #100).

This commit is contained in:
Felix Ableitner 2014-08-24 16:51:17 +02:00
parent 734cbf8d9f
commit 4f9f7f123c

View file

@ -454,7 +454,17 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener {
r.Directory = json.getString("Directory"); r.Directory = json.getString("Directory");
r.ID = json.getString("ID"); r.ID = json.getString("ID");
r.Invalid = json.getString("Invalid"); r.Invalid = json.getString("Invalid");
r.Nodes = getNodes(json.getJSONArray("Nodes")); r.Nodes = new ArrayList<Node>();
JSONArray nodes = json.getJSONArray("Nodes");
for (int j = 0; i < nodes.length(); i++) {
JSONObject n = nodes.getJSONObject(i);
String id = n.getString("NodeID");
for (Node n2 : getNodes()) {
if (n2.NodeID.equals(id)) {
r.Nodes.add(n2);
}
}
}
r.ReadOnly = json.getBoolean("ReadOnly"); r.ReadOnly = json.getBoolean("ReadOnly");
JSONObject versioning = json.getJSONObject("Versioning"); JSONObject versioning = json.getJSONObject("Versioning");