File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -51,14 +51,12 @@ interface ICartContext {
5151 cart : RootObject | null | undefined ;
5252 setCart : React . Dispatch < React . SetStateAction < TRootObjectNull > > ;
5353 updateCart : ( newCart : RootObject ) => void ;
54- isLoading : boolean ;
5554}
5655
5756const CartState : ICartContext = {
5857 cart : null ,
5958 setCart : ( ) => { } ,
6059 updateCart : ( ) => { } ,
61- isLoading : true ,
6260} ;
6361
6462export const CartContext = createContext < ICartContext > ( CartState ) ;
@@ -68,7 +66,6 @@ export const CartContext = createContext<ICartContext>(CartState);
6866 */
6967export const CartProvider = ( { children } : ICartProviderProps ) => {
7068 const [ cart , setCart ] = useState < RootObject | null > ( ) ;
71- const [ isLoading , setIsLoading ] = useState ( true ) ;
7269
7370 useEffect ( ( ) => {
7471 // Check if we are client-side before we access the localStorage
@@ -78,7 +75,6 @@ export const CartProvider = ({ children }: ICartProviderProps) => {
7875 const cartData : RootObject = JSON . parse ( localCartData ) ;
7976 setCart ( cartData ) ;
8077 }
81- setIsLoading ( false ) ;
8278 }
8379 } , [ ] ) ;
8480
@@ -90,8 +86,8 @@ export const CartProvider = ({ children }: ICartProviderProps) => {
9086 } ;
9187
9288 const contextValue = useMemo ( ( ) => {
93- return { cart, setCart, updateCart, isLoading } ;
94- } , [ cart , isLoading ] ) ;
89+ return { cart, setCart, updateCart } ;
90+ } , [ cart ] ) ;
9591
9692 return (
9793 < CartContext . Provider value = { contextValue } >
You can’t perform that action at this time.
0 commit comments