Fix default daemon/remote node RPC port based on the network type

This commit is contained in:
xiphon
2019-02-17 14:33:12 +00:00
parent 0064e595c3
commit 3aff7ddcef
3 changed files with 17 additions and 6 deletions

View File

@@ -196,7 +196,7 @@ ColumnLayout {
daemonPortText: {
var node_split = persistentSettings.bootstrapNodeAddress.split(":");
if(node_split.length == 2){
(node_split[1].trim() == "") ? "18081" : node_split[1];
(node_split[1].trim() == "") ? appWindow.getDefaultDaemonRpcPort(persistentSettings.nettype) : node_split[1];
} else {
return ""
}
@@ -228,7 +228,7 @@ ColumnLayout {
id: remoteNodeEdit
property var rna: persistentSettings.remoteNodeAddress
daemonAddrText: rna.search(":") != -1 ? rna.split(":")[0].trim() : ""
daemonPortText: rna.search(":") != -1 ? (rna.split(":")[1].trim() == "") ? "18081" : persistentSettings.remoteNodeAddress.split(":")[1] : ""
daemonPortText: rna.search(":") != -1 ? (rna.split(":")[1].trim() == "") ? appWindow.getDefaultDaemonRpcPort(persistentSettings.nettype) : persistentSettings.remoteNodeAddress.split(":")[1] : ""
placeholderFontBold: true
placeholderFontFamily: "Arial"