From 4349907627b3912d52d1560a12ad76c8f17e99f7 Mon Sep 17 00:00:00 2001 From: m2049r Date: Tue, 18 Jun 2019 08:49:51 +0200 Subject: [PATCH] setNode blocks => call it async (#604) --- app/src/main/java/com/m2049r/xmrwallet/LoginFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/m2049r/xmrwallet/LoginFragment.java b/app/src/main/java/com/m2049r/xmrwallet/LoginFragment.java index 25f6a89..a3a10ef 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/LoginFragment.java +++ b/app/src/main/java/com/m2049r/xmrwallet/LoginFragment.java @@ -439,10 +439,13 @@ public class LoginFragment extends Fragment implements WalletInfoAdapter.OnInter } Collections.sort(nodesToTest, NodeInfo.BestNodeComparator); NodeInfo bestNode = nodesToTest.get(0); - if (bestNode.isValid()) + if (bestNode.isValid()) { + activityCallback.setNode(bestNode); return bestNode; - else + } else { + activityCallback.setNode(null); return null; + } } @Override @@ -450,7 +453,6 @@ public class LoginFragment extends Fragment implements WalletInfoAdapter.OnInter if (!isAdded()) return; pbNode.setVisibility(View.INVISIBLE); llNode.setVisibility(View.VISIBLE); - activityCallback.setNode(result); if (result != null) { Timber.d("found a good node %s", result.toString()); showNode(result);