Prevent skuinfo API calls when product is marked inactive
This commit is contained in:
parent
7c651d3b4e
commit
79450e4b35
1 changed files with 2 additions and 2 deletions
|
|
@ -117,7 +117,7 @@ export default function ProductDetailPage() {
|
|||
|
||||
// Fetch languages on mount
|
||||
useEffect(() => {
|
||||
if (!productId || !isValidated) return
|
||||
if (!productId || !isValidated || !meta.active) return
|
||||
setIsLoadingLangs(true)
|
||||
setError(null)
|
||||
setDownloadLinks([])
|
||||
|
|
@ -138,7 +138,7 @@ export default function ProductDetailPage() {
|
|||
})
|
||||
.catch(e => setError(e.message))
|
||||
.finally(() => setIsLoadingLangs(false))
|
||||
}, [productId, isValidated])
|
||||
}, [productId, isValidated, meta.active])
|
||||
|
||||
async function handleGetLinks() {
|
||||
if (!selectedSku || !productId) return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue