downgrade next.js: fixes

This commit is contained in:
Lucian Felix Ghita 2023-08-11 12:15:12 +02:00
parent ea5e8fc486
commit 0c087438e7
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View File

@ -14,7 +14,8 @@ export const addItem = async (variantId: string | undefined): Promise<String | u
if (!cartId || !cart) {
cart = await createCart();
cartId = cart.id;
cookies().set('cartId', cartId);
// TODO: this is not working under older Next.js versions
// cookies().set('cartId', cartId);
}
if (!variantId) {

View File

@ -82,7 +82,8 @@ export function VariantSelector({
aria-disabled={!isAvailableForSale}
disabled={!isAvailableForSale}
onClick={() => {
router.replace(optionUrl, { scroll: false });
// TODO: Does now work under old Next.js
// router.replace(optionUrl, { scroll: false });
}}
title={`${option.name} ${value}${!isAvailableForSale ? ' (Out of Stock)' : ''}`}
className={clsx(