mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-20 11:29:20 +00:00
fix(@desktop/wallet): properly handle tx send error
This commit is contained in:
parent
3ce2ec82e2
commit
0a358f66bf
@ -450,11 +450,13 @@ proc sendNotification[T](self: Module[T], status: string, sendDetails: SendDetai
|
||||
fromAsset = sendDetails.fromToken
|
||||
toAsset = sendDetails.toToken
|
||||
error = ""
|
||||
txHash = ""
|
||||
isApprovalTx = false
|
||||
|
||||
if not sendDetails.errorResponse.isNil:
|
||||
error = sendDetails.errorResponse.details
|
||||
|
||||
if sentTransaction.hash.len > 0:
|
||||
if not sentTransaction.isNil and sentTransaction.hash.len > 0:
|
||||
txTo = sentTransaction.toAddress
|
||||
if sentTransaction.fromChain > 0:
|
||||
fromChain = sentTransaction.fromChain
|
||||
@ -471,6 +473,8 @@ proc sendNotification[T](self: Module[T], status: string, sendDetails: SendDetai
|
||||
fromAsset = sentTransaction.fromToken
|
||||
if sentTransaction.toToken.len > 0:
|
||||
toAsset = sentTransaction.toToken
|
||||
txHash = sentTransaction.hash
|
||||
isApprovalTx = sentTransaction.approvalTx
|
||||
|
||||
|
||||
var accFromName = ""
|
||||
@ -505,8 +509,8 @@ proc sendNotification[T](self: Module[T], status: string, sendDetails: SendDetai
|
||||
accToName,
|
||||
txTo,
|
||||
txToName,
|
||||
sentTransaction.hash,
|
||||
sentTransaction.approvalTx,
|
||||
txHash,
|
||||
isApprovalTx,
|
||||
fromAmount,
|
||||
toAmount,
|
||||
fromAsset,
|
||||
|
@ -55,11 +55,17 @@ proc delete*(self: Controller) =
|
||||
proc init*(self: Controller) =
|
||||
self.events.on(SIGNAL_TRANSACTION_SENT) do(e:Args):
|
||||
let args = TransactionArgs(e)
|
||||
var
|
||||
txHash = ""
|
||||
isApprovalTx = false
|
||||
if not args.sentTransaction.isNil:
|
||||
txHash = args.sentTransaction.hash
|
||||
isApprovalTx = args.sentTransaction.approvalTx
|
||||
self.delegate.transactionWasSent(
|
||||
args.sendDetails.uuid,
|
||||
args.sendDetails.fromChain,
|
||||
args.sentTransaction.approvalTx,
|
||||
args.sentTransaction.hash,
|
||||
isApprovalTx,
|
||||
txHash,
|
||||
if not args.sendDetails.errorResponse.isNil: args.sendDetails.errorResponse.details else: ""
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user