Browse Source

Refactor code rename flag variable in hasDevice.

pull/4/head
Mushegh Sahakyan 4 years ago
parent
commit
55c12c270f
1 changed files with 3 additions and 3 deletions
  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 View File

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


Loading…
Cancel
Save