mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 07:26:19 +00:00
🆙 Fix the catalog search in some cases it will give a black screen
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user