restore cart across devices #310

Merged
RecentRunner merged 1 commits from worktree-fix-cart-sessions into main 2026-04-15 15:43:42 -06:00
Showing only changes of commit f1671aef2c - Show all commits

View File

@@ -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);