feat(@wallet): empty fallback url

This commit is contained in:
Anthony Laibe 2023-09-15 10:13:21 +02:00
parent 848d3b14f5
commit 5b3b673eca
2 changed files with 27 additions and 4 deletions

View File

@ -22,7 +22,8 @@ ColumnLayout {
Verified,
InvalidURL,
PingUnsuccessful,
SameAsOther
SameAsOther,
Empty
}
QtObject {
@ -167,6 +168,10 @@ ColumnLayout {
return network.rpcURL
}
onTextChanged: {
if (text === "") {
d.evaluationStatusMainRpc = EditNetworkForm.Empty
return
}
if(!!text &&
(network.originalRpcURL === network.rpcURL && text !== network.rpcURL.replace(/(.*\/).*/, '$1')) ||
(network.originalRpcURL !== network.rpcURL && text !== network.rpcURL)) {
@ -176,8 +181,14 @@ ColumnLayout {
}
errorMessageCmp.horizontalAlignment: d.getErrorMessageAlignment(d.evaluationStatusMainRpc)
errorMessageCmp.visible: d.evaluationStatusMainRpc !== EditNetworkForm.UnTouched
errorMessageCmp.text: d.getUrlStatusText(d.evaluationStatusMainRpc, text)
errorMessageCmp.color: d.getErrorMessageColor(d.evaluationStatusMainRpc)
errorMessageCmp.text: {
if (text === "") {
return qsTr("Main JSON RPC URL is required")
}
return d.getUrlStatusText(d.evaluationStatusMainRpc, text)
}
}
}
@ -195,6 +206,11 @@ ColumnLayout {
return network.fallbackURL
}
onTextChanged: {
if (text === "") {
d.evaluationStatusFallBackRpc = EditNetworkForm.Empty
return
}
if(!!text &&
(network.originalFallbackURL === network.fallbackURL && text !== network.fallbackURL.replace(/(.*\/).*/, '$1')) ||
(network.originalFallbackURL !== network.fallbackURL && text !== network.fallbackURL)) {
@ -236,7 +252,14 @@ ColumnLayout {
}
StatusButton {
text: qsTr("Save Changes")
enabled: (d.evaluationStatusMainRpc === EditNetworkForm.Verified || d.evaluationStatusFallBackRpc === EditNetworkForm.Verified || d.evaluationStatusMainRpc === EditNetworkForm.SameAsOther || d.evaluationStatusFallBackRpc === EditNetworkForm.SameAsOther) && warningCheckbox.checked
enabled: (
d.evaluationStatusMainRpc === EditNetworkForm.Verified ||
d.evaluationStatusFallBackRpc === EditNetworkForm.Verified ||
d.evaluationStatusMainRpc === EditNetworkForm.SameAsOther ||
d.evaluationStatusFallBackRpc === EditNetworkForm.SameAsOther ||
d.evaluationStatusFallBackRpc === EditNetworkForm.Empty
) && warningCheckbox.checked
onClicked: root.updateNetworkValues(network.chainId, mainRpcInput.text, failoverRpcUrlInput.text)
}
}

2
vendor/status-go vendored

@ -1 +1 @@
Subproject commit e337ab4f13e196d2c83d9f99aef68b5b79066695
Subproject commit e98952588d767eff86e3f3cee5731cb7ecdc4db0