From f8f2a4b05e22c200b6104800753cb2d3a6cbc8bb Mon Sep 17 00:00:00 2001 From: Harkamal Randhawa Date: Wed, 15 Apr 2026 15:42:55 -0600 Subject: [PATCH] restore cart across devices --- web/context/CartContext.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/context/CartContext.js b/web/context/CartContext.js index f1c76220..f0511aaf 100644 --- a/web/context/CartContext.js +++ b/web/context/CartContext.js @@ -45,6 +45,12 @@ export function CartProvider({ children }) { } }, []); + useEffect(() => { + if (user?.storeId && !localStorage.getItem(STORE_KEY)) { + setStoreId(user.storeId); + } + }, [user, setStoreId]); + const refreshCart = useCallback(async () => { if (!token || !selectedStoreId) { setCart(null);