From 0eb6649b7a21ab03824e562edec92d3080cf8e16 Mon Sep 17 00:00:00 2001 From: Thebora Kompanioni Date: Wed, 1 Feb 2023 21:49:28 +0100 Subject: [PATCH] fix(fb): correctly display success screen after unlocking fb (#601) --- src/components/Earn.jsx | 92 ++++++++++---------- src/components/fb/SpendFidelityBondModal.tsx | 2 +- 2 files changed, 45 insertions(+), 49 deletions(-) diff --git a/src/components/Earn.jsx b/src/components/Earn.jsx index fc1086418..a39de3c5a 100644 --- a/src/components/Earn.jsx +++ b/src/components/Earn.jsx @@ -400,55 +400,51 @@ export default function Earn({ wallet }) { subtitle={t('earn.subtitle_fidelity_bonds')} />
- {currentWalletInfo && fidelityBonds.length > 0 && ( - <> - {moveToJarFidelityBondId && ( - { - setMoveToJarFidelityBondId(undefined) - if (mustReload) { - reloadFidelityBonds({ delay: 0 }) - } - }} - /> - )} - {fidelityBonds.map((fidelityBond, index) => { - const isExpired = !fb.utxo.isLocked(fidelityBond) - const actionsEnabled = - isExpired && - serviceInfo && - !serviceInfo.coinjoinInProgress && - !serviceInfo.makerRunning && - !isWaitingMakerStart && - !isWaitingMakerStop && - !isLoading - return ( - - {actionsEnabled && ( -
-
- setMoveToJarFidelityBondId(fidelityBond.utxo)} - > - - {t('earn.fidelity_bond.existing.button_spend')} - -
-
- )} -
- ) - })} - + {currentWalletInfo && moveToJarFidelityBondId && ( + { + setMoveToJarFidelityBondId(undefined) + if (mustReload) { + reloadFidelityBonds({ delay: 0 }) + } + }} + /> )} + {fidelityBonds.map((fidelityBond, index) => { + const isExpired = !fb.utxo.isLocked(fidelityBond) + const actionsEnabled = + isExpired && + serviceInfo && + !serviceInfo.coinjoinInProgress && + !serviceInfo.makerRunning && + !isWaitingMakerStart && + !isWaitingMakerStop && + !isLoading + return ( + + {actionsEnabled && ( +
+
+ setMoveToJarFidelityBondId(fidelityBond.utxo)} + > + + {t('earn.fidelity_bond.existing.button_spend')} + +
+
+ )} +
+ ) + })} <> {!serviceInfo?.makerRunning && !isWaitingMakerStart && diff --git a/src/components/fb/SpendFidelityBondModal.tsx b/src/components/fb/SpendFidelityBondModal.tsx index 91aeb0c49..fbc978e27 100644 --- a/src/components/fb/SpendFidelityBondModal.tsx +++ b/src/components/fb/SpendFidelityBondModal.tsx @@ -393,7 +393,7 @@ const SpendFidelityBondModal = ({
onClose({ txInfo, mustReload: parentMustReload })} className="flex-1 d-flex justify-content-center align-items-center" >