Skip to content

Commit

Permalink
stripe-connection-bug - add retry logic to the donation mutation (#1390)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitur2204 authored Mar 16, 2023
1 parent 5b86c28 commit cb97449
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/common/hooks/donation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ export function useDonationSession() {
mutationFn: createCheckoutSession,
onError: () => AlertStore.show(t('common:alerts.error'), 'error'),
onSuccess: () => AlertStore.show(t('common:alerts.message-sent'), 'success'),
retry(failureCount, error) {
if (failureCount < 4) {
return true
}
return false
},
retryDelay: 1000,
})
return mutation
}
Expand Down

0 comments on commit cb97449

Please sign in to comment.