Bläddra i källkod

Refactor code rename flag variable in hasDevice.

pull/4/head
Mushegh Sahakyan 4 år sedan
förälder
incheckning
55c12c270f
1 ändrade filer med 3 tillägg och 3 borttagningar
  1. +3
    -3
      ui/src/main/java/com/wireguard/android/repository/DataRepository.java

+ 3
- 3
ui/src/main/java/com/wireguard/android/repository/DataRepository.java Visa fil

@@ -83,15 +83,15 @@ public class DataRepository {
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(listDevices->{
boolean flag = true;
boolean hasDevice = false;
for (Device item : listDevices) {
if (UserStore.getInstance(context).getDeviceID().equals(item.getUuid())) {
setMutableLiveData(StatusResource.success());
flag = false;
hasDevice = true;
break;
}
}
if(flag) {
if(!hasDevice) {
addDevice(context);
}
},throwable -> {


Laddar…
Avbryt
Spara