Skip to content

Commit

Permalink
fix: [Sale Widget] Enable retries after a Transak order fails (#1435)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhesgodi authored Feb 1, 2024
1 parent be71723 commit 39334fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export const useSignOrder = (input: SignOrderInput) => {
}`.toLowerCase();
transactionHash = (err as any)?.transactionHash;

let errorType = SaleErrorTypes.DEFAULT;
let errorType = SaleErrorTypes.WALLET_FAILED;
if (reason.includes('rejected') && reason.includes('user')) {
errorType = SaleErrorTypes.WALLET_REJECTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ export function SaleErrorView({
},
},
[SaleErrorTypes.TRANSAK_FAILED]: {
onActionClick: () => {
/* TODO: start over the transak flow */
},
onActionClick: goBackToPaymentMethods,
onSecondaryActionClick: closeWidget,
statusType: StatusType.INFORMATION,
},
Expand Down Expand Up @@ -103,11 +101,6 @@ export function SaleErrorView({
onSecondaryActionClick: closeWidget,
statusType: StatusType.INFORMATION,
},
[SaleErrorTypes.DEFAULT]: {
onActionClick: goBackToPaymentMethods,
onSecondaryActionClick: closeWidget,
statusType: StatusType.INFORMATION,
},
[SaleErrorTypes.INVALID_PARAMETERS]: {
onSecondaryActionClick: closeWidget,
statusType: StatusType.ALERT,
Expand All @@ -116,6 +109,11 @@ export function SaleErrorView({
transform: 'none',
},
},
[SaleErrorTypes.DEFAULT]: {
onActionClick: goBackToPaymentMethods,
onSecondaryActionClick: closeWidget,
statusType: StatusType.INFORMATION,
},
};

const getErrorViewProps = (): StatusViewProps => {
Expand Down

0 comments on commit 39334fb

Please sign in to comment.