🆙 Fix the catalog search in some cases it will give a black screen

This commit is contained in:
duckietm
2026-04-01 17:12:09 +02:00
parent bfb56f0a4e
commit 6ad9a0c7b9
5 changed files with 37 additions and 30 deletions
@@ -18,16 +18,18 @@ export const CatalogGridOfferView: FC<CatalogGridOfferViewProps> = props =>
const { requestOfferToMover = null } = useCatalog();
const { isVisible = false } = useInventoryFurni();
const { isFavoriteOffer, toggleFavoriteOffer } = useCatalogFavorites();
const isFav = isFavoriteOffer(offer.offerId);
const isFav = offer ? isFavoriteOffer(offer.offerId) : false;
const iconUrl = useMemo(() =>
{
if(!offer) return null;
if(offer.pricingModel === Offer.PRICING_MODEL_BUNDLE)
{
return null;
}
return offer.product.getIconUrl(offer);
return offer.product?.getIconUrl(offer) ?? null;
}, [ offer ]);
const onMouseEvent = (event: MouseEvent) =>
@@ -49,6 +51,8 @@ export const CatalogGridOfferView: FC<CatalogGridOfferViewProps> = props =>
}
};
if(!offer) return null;
const product = offer.product;
if(!product) return null;