Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Commit

Permalink
Resolve issue with redirections after completed checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofwolski committed Mar 22, 2022
1 parent cd1f2a4 commit 6aea7ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/checkout/payments/DummyCreditCardSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ export const DummyCreditCardSection = ({
handleSubmit: handleSubmitCard,
formState: { errors: errorsAddress },
setError: setErrorCard,
} = useForm<CardForm>({});
} = useForm<CardForm>({ defaultValues });

const redirectToOrderDetailsPage = () => {
const redirectToOrderDetailsPage = async () => {
// without the `await` checkout data will be removed before the redirection which will cause issue with rendering checkout view
await router.push(paths.order.$url());
resetCheckoutToken();

router.push(paths.order.$url());
};

const handleSubmit = handleSubmitCard(async (formData: CardForm) => {
Expand Down

0 comments on commit 6aea7ac

Please sign in to comment.