From b279bcedc29843320a28f813ee312981bffc37ec Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Mon, 28 Oct 2024 18:28:18 +0100 Subject: [PATCH] fix(@desktop/wallet): Swap transaction - Wrong copy on the tooltip of the 'Swap' button fixes #16568 --- .../AppLayouts/Wallet/popups/swap/SwapModal.qml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/popups/swap/SwapModal.qml b/ui/app/AppLayouts/Wallet/popups/swap/SwapModal.qml index fe4594a0c2..39bd5b5e8b 100644 --- a/ui/app/AppLayouts/Wallet/popups/swap/SwapModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/swap/SwapModal.qml @@ -407,9 +407,18 @@ StatusDialog { } return qsTr("Swap") } - tooltip.text: root.swapAdaptor.validSwapProposalReceived && - root.swapAdaptor.swapOutputData.approvalNeeded ? - qsTr("Approve %1 spending cap to Swap").arg(fromTokenSymbol) : "" + tooltip.text: { + if(root.swapAdaptor.validSwapProposalReceived) { + if(root.swapAdaptor.swapOutputData.approvalNeeded) { + if (root.swapAdaptor.approvalPending) { + return qsTr("Approving %1 spending cap to Swap").arg(fromTokenSymbol) + } else if(!root.swapAdaptor.approvalSuccessful) { + return qsTr("Approve %1 spending cap to Swap").arg(fromTokenSymbol) + } + } + } + return "" + } disabledColor: Theme.palette.directColor8 interactive: root.swapAdaptor.validSwapProposalReceived && editSlippagePanel.valid &&