OwlCyberSecurity - MANAGER
Edit File: page.tsx
"use client"; import React, { useEffect } from "react"; import CheckoutChina from "../CheckoutChina"; import { useDispatch } from "react-redux"; import { updateAmazonCart } from "@/redux/features/amazonBasketSlice"; import { updateEbayCart } from "@/redux/features/ebayBasketSlice"; import { updateTurkeyCart } from "@/redux/features/turkeyBasketSlice"; import { updateEmiratesCart } from "@/redux/features/emirateBasketSlice"; import { updateChinaCart } from "@/redux/features/chinaBasketSlice"; import { updateOtherCart } from "@/redux/features/otherBasketSlice"; function CheckoutChinaPage() { const dispatch = useDispatch(); useEffect(() => { if (localStorage.getItem("persist:root")) { const prevAmazonStateCart = JSON?.parse( // @ts-ignore JSON.parse(localStorage.getItem("persist:root")).amazonBasket ).cart; const prevEbayStateCart = JSON?.parse( // @ts-ignore JSON.parse(localStorage.getItem("persist:root")).ebayBasket ).cart; const prevTurkeyStateCart = JSON?.parse( // @ts-ignore JSON.parse(localStorage.getItem("persist:root")).turkeyBasket ).cart; const prevEmiratesStateCart = JSON?.parse( // @ts-ignore JSON.parse(localStorage.getItem("persist:root")).emirateBasket ).cart; const prevChinaStateCart = JSON?.parse( // @ts-ignore JSON.parse(localStorage.getItem("persist:root")).chinaBasket ).cart; const prevOtherStateCart = JSON?.parse( // @ts-ignore JSON.parse(localStorage.getItem("persist:root")).otherBasket ).cart; setTimeout(() => { dispatch(updateAmazonCart(prevAmazonStateCart)); dispatch(updateEbayCart(prevEbayStateCart)); dispatch(updateTurkeyCart(prevTurkeyStateCart)); dispatch(updateEmiratesCart(prevEmiratesStateCart)); dispatch(updateChinaCart(prevChinaStateCart)); dispatch(updateOtherCart(prevOtherStateCart)); }, 750); } }, []); return <CheckoutChina />; } export default CheckoutChinaPage;