diff --git a/apps/user-ui/components/cart-page.tsx b/apps/user-ui/components/cart-page.tsx index cae6dc7..b7c6b04 100644 --- a/apps/user-ui/components/cart-page.tsx +++ b/apps/user-ui/components/cart-page.tsx @@ -167,7 +167,9 @@ export default function CartPage({ isFlashDelivery = false }: CartPageProps) { const getAvailableSlotsForProduct = React.useMemo(() => { return (productId: number) => { if (!slotsData || !slotsData[productId]) return []; - return slotsData[productId].map((slot) => { + return slotsData[productId] + .filter((slot) => dayjs(slot.freezeTime).isAfter(dayjs())) + .map((slot) => { const formatTimeRange = (deliveryTime: string) => { const time = dayjs(deliveryTime); const endTime = time.add(1, 'hour'); @@ -184,11 +186,11 @@ export default function CartPage({ isFlashDelivery = false }: CartPageProps) { return `${time.format('ddd, DD MMM ')}${timeRange}`; }; - return { - label: `Delivery: ${formatTimeRange(slot.deliveryTime)} - Close time: ${dayjs(slot.freezeTime).format("h:mm a")}`, - value: slot.id, - }; - }); + return { + label: `Delivery: ${formatTimeRange(slot.deliveryTime)} - Close time: ${dayjs(slot.freezeTime).format("h:mm a")}`, + value: slot.id, + }; + }); }; }, [slotsData]); @@ -303,11 +305,11 @@ export default function CartPage({ isFlashDelivery = false }: CartPageProps) { if (!productSlots || productSlots.length === 0) return; const now = dayjs(); - const upcomingSlots = productSlots.filter(slot => - dayjs(slot.deliveryTime).isAfter(now) - ).sort((a, b) => - dayjs(a.deliveryTime).diff(dayjs(b.deliveryTime)) - ); + const upcomingSlots = productSlots + .filter((slot) => dayjs(slot.freezeTime).isAfter(now)) + .sort((a, b) => + dayjs(a.deliveryTime).diff(dayjs(b.deliveryTime)) + ); if (upcomingSlots.length > 0) { diff --git a/packages/ui/index.ts b/packages/ui/index.ts index 30549a9..97be492 100755 --- a/packages/ui/index.ts +++ b/packages/ui/index.ts @@ -64,9 +64,9 @@ const isDevMode = Constants.executionEnvironment !== "standalone"; // const BASE_API_URL = 'http://10.0.2.2:4000'; // const BASE_API_URL = 'http://192.168.100.101:4000'; // const BASE_API_URL = 'http://192.168.1.5:4000'; -let BASE_API_URL = "https://mf.freshyo.in"; +let BASE_API_URL = "https://raw.freshyo.in"; // let BASE_API_URL = "https://freshyo.technocracy.ovh"; -// let BASE_API_URL = 'http://192.168.100.107:4000'; +// let BASE_API_URL = 'http://192.168.100.108:4000'; // let BASE_API_URL = 'http://192.168.29.176:4000'; // if(isDevMode) {