From 797da0a962d816bd8d63d767ca7bb7b9218ef7d2 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 11 Sep 2020 13:31:13 -0400 Subject: [PATCH] feat: add ToastMessage when transaction becomes pending --- ui/app/AppLayouts/Wallet/SendModal.qml | 18 +++++------------- ui/app/AppMain.qml | 4 ++++ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/SendModal.qml b/ui/app/AppLayouts/Wallet/SendModal.qml index b4ddb39171..1332500220 100644 --- a/ui/app/AppLayouts/Wallet/SendModal.qml +++ b/ui/app/AppLayouts/Wallet/SendModal.qml @@ -20,16 +20,6 @@ ModalPopup { icon: StandardIcon.Critical standardButtons: StandardButton.Ok } - property MessageDialog sendingSuccess: MessageDialog { - id: sendingSuccess - //% "Success sending the transaction" - title: qsTrId("success-sending-the-transaction") - icon: StandardIcon.NoIcon - standardButtons: StandardButton.Ok - onAccepted: { - root.close() - } - } onClosed: { stack.reset() @@ -274,10 +264,12 @@ ModalPopup { return sendingError.open() } - sendingSuccess.text = qsTr("Transaction sent to the blockchain. You can watch the progress on Etherscan: %2/%1").arg(response.result).arg(walletModel.etherscanLink) - sendingSuccess.open() + toastMessage.title = qsTr("Transaction pending...") + toastMessage.link = `${walletModel.etherscanLink}/${response.result}` + toastMessage.open() + root.close() } catch (e) { - console.error('WOW', e) + console.error('Error parsing the response', e) } } } diff --git a/ui/app/AppMain.qml b/ui/app/AppMain.qml index 88635fd6d5..8abfa54aad 100644 --- a/ui/app/AppMain.qml +++ b/ui/app/AppMain.qml @@ -12,6 +12,10 @@ RowLayout { Layout.fillHeight: true Layout.fillWidth: true + ToastMessage { + id: toastMessage + } + TabBar { id: tabBar width: 78