Skip to content

Commit

Permalink
Add MAX_ALLOWED_FEES_XRP in PreparePayment view
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibautBremand committed Sep 19, 2023
1 parent 31f1192 commit 75e5643
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { PageWithNavMenu, PageWithReturn, PageWithSpinner } from '../../../templ
const MAX_MEMO_LENGTH = 300;
const MAX_DESTINATION_TAG_LENGTH = 10;
const INDEX_DEFAULT_NAV = navigation.findIndex((link) => link.pathname === HOME_PATH);
const MAX_ALLOWED_FEES_XRP = 5;

export interface PreparePaymentProps {
onSendPaymentClick: ({
Expand Down Expand Up @@ -317,6 +318,13 @@ export const PreparePayment: FC<PreparePaymentProps> = ({ onSendPaymentClick })
return;
}

if (Number(e.target.value) > MAX_ALLOWED_FEES_XRP) {
setErrorTransactionFee(
`The maximum allowed transaction fee is ${MAX_ALLOWED_FEES_XRP} XRP`
);
return;
}

setErrorTransactionFee('');
},
[minimumFeeValue]
Expand Down

0 comments on commit 75e5643

Please sign in to comment.