Skip to content

Commit

Permalink
fixup! feat: add error state for RBF when previous transaction gets m…
Browse files Browse the repository at this point in the history
…ined befor user sends the modal
  • Loading branch information
peter-sanderson committed Feb 7, 2025
1 parent ab11f93 commit 9f1c31a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ type TransactionReviewModalContentProps = {
decision: Deferred<boolean, string | number | undefined> | undefined;
txInfoState: SendState | StakeState;
cancelSignTx: () => void;

// Just bool for now, but could be extended into generic error in the future
isRbfConfirmedError?: boolean;
};

Expand Down Expand Up @@ -182,7 +180,11 @@ export const TransactionReviewModalContent = ({
);
}

if (!areDetailsVisible && isBroadcastEnabled) {
if (areDetailsVisible) {
return null;
}

if (isBroadcastEnabled) {
return (
<NewModal.Button
data-testid="@modal/send"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ import {
import { Translation, TranslationKey } from '../../../../Translation';
import { TrezorLink } from '../../../../TrezorLink';

type ReplaceByFeeFailedOriginalTxConfirmedParams = {
type ReplaceByFeeFailedOriginalTxConfirmedProps = {
type: 'replace-by-fee' | 'cancel-transaction';
};

const titleMap: Record<ReplaceByFeeFailedOriginalTxConfirmedParams['type'], TranslationKey> = {
const titleMap: Record<ReplaceByFeeFailedOriginalTxConfirmedProps['type'], TranslationKey> = {
'replace-by-fee': 'TR_REPLACE_BY_FEE_FAILED_ALREADY_MINED',
'cancel-transaction': 'TR_CANCEL_TX_FAILED_ALREADY_MINED',
};

const descriptionMap: Record<ReplaceByFeeFailedOriginalTxConfirmedParams['type'], TranslationKey> =
const descriptionMap: Record<ReplaceByFeeFailedOriginalTxConfirmedProps['type'], TranslationKey> =
{
'replace-by-fee': 'TR_REPLACE_BY_FEE_FAILED_ALREADY_MINED_DESCRIPTION',
'cancel-transaction': 'TR_CANCEL_TX_FAILED_ALREADY_MINED_DESCRIPTION',
};

const helpLink: Record<ReplaceByFeeFailedOriginalTxConfirmedParams['type'], Url> = {
const helpLink: Record<ReplaceByFeeFailedOriginalTxConfirmedProps['type'], Url> = {
'replace-by-fee': HELP_CENTER_REPLACE_BY_FEE_BITCOIN,
'cancel-transaction': HELP_CENTER_CANCEL_TRANSACTION,
};

export const ReplaceByFeeFailedOriginalTxConfirmed = ({
type,
}: ReplaceByFeeFailedOriginalTxConfirmedParams) => (
}: ReplaceByFeeFailedOriginalTxConfirmedProps) => (
<Card fillType="flat">
<Column gap={spacings.xs}>
<Box margin={{ bottom: spacings.md }}>
Expand Down

0 comments on commit 9f1c31a

Please sign in to comment.