fix(store): always revalidate public storefront product list
The seller store page (useGetSellerProducts) inherited the global 30s staleTime with refetchOnWindowFocus disabled, so after a seller edited a price the store tiles could keep showing the pre-edit price while the (SSR) single-product page already showed the new one — a list-vs-detail mismatch. The backend serves both from live DB and is consistent. Set staleTime: 0 + refetchOnMount/refetchOnWindowFocus on the storefront query so it revalidates on every visit and tab refocus, keeping the list prices current. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
272362cfdf
commit
940cc3e859
@ -148,6 +148,13 @@ export const useGetSellerProducts = (
|
|||||||
},
|
},
|
||||||
initialPageParam: 1,
|
initialPageParam: 1,
|
||||||
enabled: !!sellerId,
|
enabled: !!sellerId,
|
||||||
|
// Public storefront: prices/discounts must reflect the seller's latest
|
||||||
|
// edits. Always treat as stale and revalidate on mount/refocus so the
|
||||||
|
// store list can't keep showing a pre-edit price (the detail page is SSR
|
||||||
|
// and already fresh, which caused the list-vs-detail mismatch).
|
||||||
|
staleTime: 0,
|
||||||
|
refetchOnMount: true,
|
||||||
|
refetchOnWindowFocus: true,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user