mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2024-11-25 08:52:28 +00:00
More bug fixes
This commit is contained in:
parent
db3c4c424b
commit
9e70f64e39
3 changed files with 5 additions and 4 deletions
|
@ -78,7 +78,7 @@ public class NodeSelectionBottomSheetDialog extends BottomSheetDialogFragment im
|
|||
Node node = Node.fromString(nodeString);
|
||||
if (node != null) {
|
||||
nodes.add(node);
|
||||
jsonArray.put(i, node.toJson().toString());
|
||||
jsonArray.put(i, node.toJson());
|
||||
} else {
|
||||
jsonArray.remove(i);
|
||||
}
|
||||
|
|
|
@ -300,7 +300,7 @@ public class SettingsFragment extends Fragment implements PasswordBottomSheetDia
|
|||
JSONObject nodeJsonObject = jsonArray.getJSONObject(i);
|
||||
Node savedNode = Node.fromJson(nodeJsonObject);
|
||||
if (savedNode.toNodeString().equals(oldNode.toNodeString()))
|
||||
jsonArray.put(i, newNode.toNodeString());
|
||||
jsonArray.put(i, newNode.toJson());
|
||||
}
|
||||
saveNodesAndReopen(jsonArray);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import androidx.lifecycle.ViewModel;
|
|||
|
||||
import net.mynero.wallet.MoneroApplication;
|
||||
import net.mynero.wallet.data.DefaultNodes;
|
||||
import net.mynero.wallet.data.Node;
|
||||
import net.mynero.wallet.model.WalletManager;
|
||||
import net.mynero.wallet.service.PrefService;
|
||||
import net.mynero.wallet.util.Constants;
|
||||
|
@ -18,8 +19,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().getNode().toNodeString();
|
||||
boolean isNodeLocalIp = currentNodeString.startsWith("10.") || currentNodeString.startsWith("192.168.") || currentNodeString.equals("localhost") || currentNodeString.equals("127.0.0.1");
|
||||
Node curretNode = PrefService.getInstance().getNode();
|
||||
boolean isNodeLocalIp = curretNode.getAddress().startsWith("10.") || curretNode.getAddress().startsWith("192.168.") || curretNode.getAddress().equals("localhost") || curretNode.getAddress().equals("127.0.0.1");
|
||||
|
||||
if (!usesProxy || isNodeLocalIp) {
|
||||
WalletManager.getInstance().setProxy("");
|
||||
|
|
Loading…
Reference in a new issue