diff --git a/src/hooks/usePricing.js b/src/hooks/usePricing.js index 00ff4a6..27a7ca1 100644 --- a/src/hooks/usePricing.js +++ b/src/hooks/usePricing.js @@ -10,8 +10,8 @@ export function usePricing() { .from('settings') .select('key, value') .in('key', ['price_200', 'price_300']) - .then(({ data }) => { - if (data) { + .then(({ data, error }) => { + if (!error && data) { const map = {}; data.forEach(({ key, value }) => { const thickness = parseInt(key.replace('price_', ''), 10); @@ -20,7 +20,8 @@ export function usePricing() { setPrices((prev) => ({ ...prev, ...map })); } setLoading(false); - }); + }) + .catch(() => setLoading(false)); }, []); return { prices, loading };