mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2024-11-10 05:03:26 +01:00
More bug fixes
This commit is contained in:
parent
db3c4c424b
commit
9e70f64e39
@ -78,7 +78,7 @@ public class NodeSelectionBottomSheetDialog extends BottomSheetDialogFragment im
|
|||||||
Node node = Node.fromString(nodeString);
|
Node node = Node.fromString(nodeString);
|
||||||
if (node != null) {
|
if (node != null) {
|
||||||
nodes.add(node);
|
nodes.add(node);
|
||||||
jsonArray.put(i, node.toJson().toString());
|
jsonArray.put(i, node.toJson());
|
||||||
} else {
|
} else {
|
||||||
jsonArray.remove(i);
|
jsonArray.remove(i);
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ public class SettingsFragment extends Fragment implements PasswordBottomSheetDia
|
|||||||
JSONObject nodeJsonObject = jsonArray.getJSONObject(i);
|
JSONObject nodeJsonObject = jsonArray.getJSONObject(i);
|
||||||
Node savedNode = Node.fromJson(nodeJsonObject);
|
Node savedNode = Node.fromJson(nodeJsonObject);
|
||||||
if (savedNode.toNodeString().equals(oldNode.toNodeString()))
|
if (savedNode.toNodeString().equals(oldNode.toNodeString()))
|
||||||
jsonArray.put(i, newNode.toNodeString());
|
jsonArray.put(i, newNode.toJson());
|
||||||
}
|
}
|
||||||
saveNodesAndReopen(jsonArray);
|
saveNodesAndReopen(jsonArray);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -6,6 +6,7 @@ import androidx.lifecycle.ViewModel;
|
|||||||
|
|
||||||
import net.mynero.wallet.MoneroApplication;
|
import net.mynero.wallet.MoneroApplication;
|
||||||
import net.mynero.wallet.data.DefaultNodes;
|
import net.mynero.wallet.data.DefaultNodes;
|
||||||
|
import net.mynero.wallet.data.Node;
|
||||||
import net.mynero.wallet.model.WalletManager;
|
import net.mynero.wallet.model.WalletManager;
|
||||||
import net.mynero.wallet.service.PrefService;
|
import net.mynero.wallet.service.PrefService;
|
||||||
import net.mynero.wallet.util.Constants;
|
import net.mynero.wallet.util.Constants;
|
||||||
@ -18,8 +19,8 @@ public class SettingsViewModel extends ViewModel {
|
|||||||
public void updateProxy(MoneroApplication application) {
|
public void updateProxy(MoneroApplication application) {
|
||||||
application.getExecutor().execute(() -> {
|
application.getExecutor().execute(() -> {
|
||||||
boolean usesProxy = PrefService.getInstance().getBoolean(Constants.PREF_USES_TOR, false);
|
boolean usesProxy = PrefService.getInstance().getBoolean(Constants.PREF_USES_TOR, false);
|
||||||
String currentNodeString = PrefService.getInstance().getNode().toNodeString();
|
Node curretNode = PrefService.getInstance().getNode();
|
||||||
boolean isNodeLocalIp = currentNodeString.startsWith("10.") || currentNodeString.startsWith("192.168.") || currentNodeString.equals("localhost") || currentNodeString.equals("127.0.0.1");
|
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) {
|
if (!usesProxy || isNodeLocalIp) {
|
||||||
WalletManager.getInstance().setProxy("");
|
WalletManager.getInstance().setProxy("");
|
||||||
|
Loading…
Reference in New Issue
Block a user