From c0e6465943305d2b11231c4604889321d3dc3538 Mon Sep 17 00:00:00 2001 From: pokkst Date: Fri, 14 Oct 2022 23:55:10 -0500 Subject: [PATCH] more fixes --- .../java/net/mynero/wallet/adapter/NodeSelectionAdapter.java | 4 +++- .../net/mynero/wallet/fragment/settings/SettingsFragment.java | 4 +++- .../mynero/wallet/fragment/settings/SettingsViewModel.java | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/mynero/wallet/adapter/NodeSelectionAdapter.java b/app/src/main/java/net/mynero/wallet/adapter/NodeSelectionAdapter.java index e34081d..9813dd3 100644 --- a/app/src/main/java/net/mynero/wallet/adapter/NodeSelectionAdapter.java +++ b/app/src/main/java/net/mynero/wallet/adapter/NodeSelectionAdapter.java @@ -96,7 +96,9 @@ public class NodeSelectionAdapter extends RecyclerView.Adapter { diff --git a/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsViewModel.java b/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsViewModel.java index e02585b..5ef4eab 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsViewModel.java +++ b/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsViewModel.java @@ -5,6 +5,7 @@ import android.util.Patterns; import androidx.lifecycle.ViewModel; import net.mynero.wallet.MoneroApplication; +import net.mynero.wallet.data.DefaultNodes; import net.mynero.wallet.model.WalletManager; import net.mynero.wallet.service.PrefService; import net.mynero.wallet.util.Constants; @@ -17,7 +18,8 @@ public class SettingsViewModel extends ViewModel { public void updateProxy(MoneroApplication application) { application.getExecutor().execute(() -> { boolean usesProxy = PrefService.getInstance().getBoolean(Constants.PREF_USES_TOR, false); - String currentNodeString = PrefService.getInstance().getString(Constants.PREF_NODE_2, ""); + DefaultNodes defaultNode = usesProxy ? DefaultNodes.SAMOURAI_ONION : DefaultNodes.SAMOURAI; + String currentNodeString = PrefService.getInstance().getString(Constants.PREF_NODE_2, defaultNode.getUri()); boolean isNodeLocalIp = currentNodeString.startsWith("10.") || currentNodeString.startsWith("192.168.") || currentNodeString.equals("localhost") || currentNodeString.equals("127.0.0.1"); if (!usesProxy || isNodeLocalIp) {