From 9f1c31ae69a500703a2da9f1bd7a2ac0bc3d6e7c Mon Sep 17 00:00:00 2001 From: Peter Sanderson Date: Fri, 7 Feb 2025 16:46:21 +0100 Subject: [PATCH] fixup! feat: add error state for RBF when previous transaction gets mined befor user sends the modal --- .../TransactionReviewModalContent.tsx | 8 +++++--- .../ReplaceByFeeFailedOriginalTxConfirmed.tsx | 10 +++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx index c40b2b85e01..cc83a639d36 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/TransactionReviewModal/TransactionReviewModalContent.tsx @@ -44,8 +44,6 @@ type TransactionReviewModalContentProps = { decision: Deferred | undefined; txInfoState: SendState | StakeState; cancelSignTx: () => void; - - // Just bool for now, but could be extended into generic error in the future isRbfConfirmedError?: boolean; }; @@ -182,7 +180,11 @@ export const TransactionReviewModalContent = ({ ); } - if (!areDetailsVisible && isBroadcastEnabled) { + if (areDetailsVisible) { + return null; + } + + if (isBroadcastEnabled) { return ( = { +const titleMap: Record = { 'replace-by-fee': 'TR_REPLACE_BY_FEE_FAILED_ALREADY_MINED', 'cancel-transaction': 'TR_CANCEL_TX_FAILED_ALREADY_MINED', }; -const descriptionMap: Record = +const descriptionMap: Record = { 'replace-by-fee': 'TR_REPLACE_BY_FEE_FAILED_ALREADY_MINED_DESCRIPTION', 'cancel-transaction': 'TR_CANCEL_TX_FAILED_ALREADY_MINED_DESCRIPTION', }; -const helpLink: Record = { +const helpLink: Record = { 'replace-by-fee': HELP_CENTER_REPLACE_BY_FEE_BITCOIN, 'cancel-transaction': HELP_CENTER_CANCEL_TRANSACTION, }; export const ReplaceByFeeFailedOriginalTxConfirmed = ({ type, -}: ReplaceByFeeFailedOriginalTxConfirmedParams) => ( +}: ReplaceByFeeFailedOriginalTxConfirmedProps) => (