1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-30 00:01:19 +00:00

Correct handling of disconnected devices (fixes #473)

This commit is contained in:
Lode Hoste 2015-11-09 12:01:51 +01:00
parent 13623d5a7e
commit 8443ba179a
2 changed files with 3 additions and 1 deletions

View file

@ -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)

View file

@ -55,7 +55,7 @@ public class DevicesAdapter extends ArrayAdapter<RestApi.Device>
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));