From 21edea4a9ac05a147e891d3d06a13dcf47533890 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 20 Jan 2021 12:05:07 -0500 Subject: [PATCH] fix: fix double popup for estimating gas errors --- .../AcceptTransaction.qml | 17 ++++------- .../SendTransactionButton.qml | 28 +++++++------------ 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/AcceptTransaction.qml b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/AcceptTransaction.qml index 76ad8f4f71..efc6b6c044 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/AcceptTransaction.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/AcceptTransaction.qml @@ -37,7 +37,7 @@ Item { if (root.state === Constants.addressRequested) { selectAccountModal.open() } else if (root.state === Constants.transactionRequested) { - signTransactionModal.open() + openPopup(signTxComponent) } } } @@ -85,21 +85,14 @@ Item { } } - Loader { - id: signTransactionModal - function open() { - this.active = true - this.item.open() - } - function closed() { - this.active = false // kill an opened instance - } - sourceComponent: SignTransactionModal { + Component { + id: signTxComponent + SignTransactionModal { onOpened: { walletModel.getGasPricePredictions() } onClosed: { - signTransactionModal.closed() + destroy(); } selectedAccount: {} selectedRecipient: { diff --git a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/SendTransactionButton.qml b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/SendTransactionButton.qml index bec5875701..be990d2364 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/SendTransactionButton.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/SendTransactionButton.qml @@ -31,32 +31,24 @@ Item { onClicked: { walletModel.setFocusedAccountByAddress(commandParametersObject.fromAddress) var acc = walletModel.focusedAccount - signTransactionModal.selectedAccount = { - name: acc.name, - address: commandParametersObject.fromAddress, - iconColor: acc.iconColor, - assets: acc.assets - } - signTransactionModal.open() + openPopup(signTxComponent, {selectedAccount: { + name: acc.name, + address: commandParametersObject.fromAddress, + iconColor: acc.iconColor, + assets: acc.assets + }}) } } } - Loader { - id: signTransactionModal - function open() { - this.active = true - this.item.open() - } - function closed() { - this.active = false // kill an opened instance - } - sourceComponent: SignTransactionModal { + Component { + id: signTxComponent + SignTransactionModal { onOpened: { walletModel.getGasPricePredictions() } onClosed: { - signTransactionModal.closed() + destroy(); } selectedRecipient: { return {