Skip to content

Commit

Permalink
fix: use Promise.all
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemoya committed Mar 28, 2024
1 parent 62049ed commit 9055cbb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ export const CheckoutSummary = async ({ cartId, locale }: { cartId: string; loca
const t = await getTranslations({ locale, namespace: 'Cart.CheckoutSummary' });
const messages = await getMessages({ locale });

const checkout = await getCheckout(cartId);
const shippingCountries = await getShippingCountries();
const [checkout, shippingCountries] = await Promise.all([
getCheckout(cartId),
getShippingCountries(),
]);

if (!checkout) {
toast.error(t('errorMessage'), {
Expand Down

0 comments on commit 9055cbb

Please sign in to comment.