Updated on 2026-08-14

This commit is contained in:
Tangem 2022-09-30 12:21:42 +04:00
parent 97b9ce696c
commit c307bc2110
4 changed files with 14 additions and 4 deletions

View file

@ -55,6 +55,7 @@ sealed class TapError(
sealed class WalletConnect {
object UnsupportedDapp : TapError(R.string.wallet_connect_error_unsupported_dapp)
object UnsupportedLink : TapError(R.string.wallet_connect_error_failed_to_connect)
}
data class ValidateTransactionErrors(

View file

@ -60,7 +60,12 @@ class WalletConnectManager {
fun connect(wcUri: String) {
val session = WCSession.from(wcUri).guard {
store.dispatchOnMain(WalletConnectAction.FailureEstablishingSession(null, true))
store.dispatchOnMain(
WalletConnectAction.FailureEstablishingSession(
session = null,
error = TapError.WalletConnect.UnsupportedLink,
),
)
return
}
if (sessions[session] != null) {
@ -74,7 +79,12 @@ class WalletConnectManager {
try {
client.connect(session, tangemPeerMeta, peerId)
} catch (exception: IllegalArgumentException) {
store.dispatchOnMain(WalletConnectAction.FailureEstablishingSession(null, true))
store.dispatchOnMain(
WalletConnectAction.FailureEstablishingSession(
session = null,
error = TapError.WalletConnect.UnsupportedLink,
),
)
return
}