fix(@desktop/wallet): Wallet: Send a multi tx, the notification for the 2nd transfer is not visible

fixes #12242
This commit is contained in:
Khushboo Mehta 2023-09-28 19:29:31 +02:00 committed by Khushboo-dev-cpp
parent e805a9bf26
commit 91de960e08
6 changed files with 20 additions and 11 deletions

View File

@ -423,6 +423,10 @@ proc connectForNotificationsOnly[T](self: Module[T]) =
kpName = args.keypairs[0].name
self.view.showToastKeypairsImported(kpName, args.keypairs.len, args.error)
self.events.on(SIGNAL_TRANSACTION_SENT) do(e:Args):
let args = TransactionSentArgs(e)
self.view.showToastTransactionSent(args.chainId, args.txHash, args.uuid, args.error)
method load*[T](
self: Module[T],
events: EventEmitter,

View File

@ -296,6 +296,7 @@ QtObject:
proc showIncludeWatchOnlyAccountUpdated*(self: View, includeWatchOnly: bool) {.signal.}
proc showToastKeypairRemoved*(self: View, keypairName: string) {.signal.}
proc showToastKeypairsImported*(self: View, keypairName: string, keypairsCount: int, error: string) {.signal.}
proc showToastTransactionSent*(self: View, chainId: int, txHash: string, uuid: string, error: string) {.signal.}
## Used in test env only, for testing keycard flows
proc registerMockedKeycard*(self: View, cardIndex: int, readerState: int, keycardState: int,

View File

@ -1,4 +1,4 @@
import NimQml, Tables, strutils, strformat, sequtils, sugar, json
import NimQml, Tables, strutils, strformat, sequtils, sugar, json, stint
import app/modules/shared_models/currency_amount
import ./network_item, ./suggested_route_item
@ -181,7 +181,7 @@ QtObject:
let index = self.createIndex(i, 0, nil)
defer: index.delete
if self.items[i].getAmountOut().len != 0:
self.items[i].amountOut = $(parseInt(self.items[i].getAmountOut()) + parseInt(path.getAmountOut()))
self.items[i].amountOut = $(stint.u256(self.items[i].getAmountOut()) + stint.u256(path.getAmountOut()))
else:
self.items[i].amountOut = path.getAmountOut()
self.dataChanged(index, index, @[ModelRole.AmountOut.int])

View File

@ -167,8 +167,8 @@ QtObject {
property var allNetworks: networksModule.all
function getEtherscanLink() {
return profileSectionModule.ensUsernamesModule.getEtherscanLink()
function getEtherscanLink(chainID) {
return allNetworks.getBlockExplorerURL(chainID)
}
function createCommunity(communityName, communityDescription, checkedMembership, communityColor, communityTags,

View File

@ -181,6 +181,17 @@ Item {
""
)
}
function onShowToastTransactionSent(chainId: int, txHash: string, uuid: string, error: string) {
if (!error) {
Global.displayToastMessage(qsTr("Transaction pending..."),
qsTr("View on etherscan"),
"",
true,
Constants.ephemeralNotificationType.normal,
"%1/%2".arg(appMain.rootStore.getEtherscanLink(chainId)).arg(txHash))
}
}
}
QtObject {

View File

@ -519,13 +519,6 @@ StatusDialog {
sendingError.text = error
return sendingError.open()
}
let url = "%1/%2".arg(popup.store.getEtherscanLink(chainId)).arg(txHash)
Global.displayToastMessage(qsTr("Transaction pending..."),
qsTr("View on etherscan"),
"",
true,
Constants.ephemeralNotificationType.normal,
url)
popup.close()
}
}