Updated on 2026-08-14
This commit is contained in:
parent
97b9ce696c
commit
c307bc2110
4 changed files with 14 additions and 4 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue