diff options
Diffstat (limited to 'src-migrate/pages')
| -rw-r--r-- | src-migrate/pages/shop/cart/index.tsx | 5 | ||||
| -rw-r--r-- | src-migrate/pages/shop/promo/index.tsx | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src-migrate/pages/shop/cart/index.tsx b/src-migrate/pages/shop/cart/index.tsx index 5e3e042a..cfb20284 100644 --- a/src-migrate/pages/shop/cart/index.tsx +++ b/src-migrate/pages/shop/cart/index.tsx @@ -78,6 +78,7 @@ const CartPage = () => { setHasChanged(false) } + // Update the ref to the current cart state prevCartRef.current = cart ? [...cart.products] : null; }, [cart]); @@ -140,7 +141,7 @@ const CartPage = () => { const handleChange = async (e: React.ChangeEvent<HTMLInputElement>) => { - + // Ensure that cart is not null before attempting to update if (cart) { const updatedCart = { ...cart, @@ -150,7 +151,7 @@ const CartPage = () => { })) }; - updateCartItem(updatedCart); + updateCartItem(updatedCart); // Pass only valid CartProps to updateCartItem if(hasSelectedAll){ setIsSelectedAll(false); }else{ diff --git a/src-migrate/pages/shop/promo/index.tsx b/src-migrate/pages/shop/promo/index.tsx index febe31a4..7bb5546d 100644 --- a/src-migrate/pages/shop/promo/index.tsx +++ b/src-migrate/pages/shop/promo/index.tsx @@ -5,6 +5,7 @@ import Hero from '~/modules/promo/components/Hero' import PromotionProgram from '~/modules/promo/components/PromotinProgram' import Voucher from '~/modules/promo/components/Voucher' import FlashSale from '../../../modules/promo/components/FlashSale' +import FlashSaleNonDisplay from '../../../modules/promo/components/FlashSaleNonDisplay' const PromoList = dynamic(() => import('../../../modules/promo/components/PromoList')); @@ -29,6 +30,10 @@ const PromoPage = () => { </LazyLoadComponent> <h1 className='h-1'></h1> <LazyLoadComponent> + <FlashSaleNonDisplay /> + </LazyLoadComponent> + <h1 className='h-1'></h1> + <LazyLoadComponent> <Voucher /> </LazyLoadComponent> </> |
