diff --git a/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java b/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java index bdaed1f9..358aa544 100644 --- a/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java +++ b/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java @@ -119,6 +119,7 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener, public String address; public String clientVersion; public int completion; + public boolean connected; } public static class Model { @@ -583,6 +584,7 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener, c.address = conn.getString("address"); c.clientVersion = conn.getString("clientVersion"); c.completion = getDeviceCompletion(deviceId); + c.connected = conn.getBoolean("connected"); Connection prev = (mPreviousConnections.containsKey(deviceId)) ? mPreviousConnections.get(deviceId) diff --git a/src/main/java/com/nutomic/syncthingandroid/util/DevicesAdapter.java b/src/main/java/com/nutomic/syncthingandroid/util/DevicesAdapter.java index bb226896..4488f918 100644 --- a/src/main/java/com/nutomic/syncthingandroid/util/DevicesAdapter.java +++ b/src/main/java/com/nutomic/syncthingandroid/util/DevicesAdapter.java @@ -55,7 +55,7 @@ public class DevicesAdapter extends ArrayAdapter name.setText(getItem(position).name); Resources r = getContext().getResources(); - if (conn != null) { + if (conn != null && conn.connected) { if (conn.completion == 100) { status.setText(r.getString(R.string.device_up_to_date)); status.setTextColor(r.getColor(R.color.text_green));