feat(dapps) fail on Wallet Connect unsupported networks

Also extend the generic error handling of approval errors

Updates: #14676
This commit is contained in:
Stefan 2024-07-08 13:40:43 +03:00 committed by Stefan Dunca
parent 498d4c969c
commit 1e256c8bf1
3 changed files with 14 additions and 1 deletions

View File

@ -131,7 +131,12 @@ QObject {
function onBuildApprovedNamespacesResult(approvedNamespaces, error) {
if(error) {
// TODO: error reporting
// Check that it contains Non conforming namespaces"
if (error.includes("Non conforming namespaces")) {
root.pairingUriValidated(Pairing.uriErrors.unsupportedNetwork)
} else {
root.pairingUriValidated(Pairing.uriErrors.unknownError)
}
return
}

View File

@ -10,5 +10,7 @@ QtObject {
readonly property int invalidUri: 3
readonly property int alreadyUsed: 4
readonly property int expired: 5
readonly property int unsupportedNetwork: 6
readonly property int unknownError: 7
}
}

View File

@ -48,6 +48,12 @@ ColumnLayout {
}
if (errorText.text.length > 0) {
return false
} else if(root.errorState === Pairing.uriErrors.unsupportedNetwork) {
errorText.text = qsTr("dApp is requesting to connect on an unsupported network")
return false
} else if(root.errorState === Pairing.uriErrors.unknownError) {
errorText.text = qsTr("Unexpected error occurred, please try again")
return false
}
return true