Merge pull request #1333 from mirumee/SALEOR-4278/3.0/product-view-channel-search-fix

fix dashboard crash when using the channel selector search field in product view
This commit is contained in:
SektorDV 2021-08-30 16:26:46 +02:00 committed by sektordv
parent 0cdcec4476
commit de0811e2d5

View file

@ -136,7 +136,13 @@ const ChannelsWithVariantsAvailabilityDialogContent: React.FC<ChannelsWithVarian
return (
<>
{map(channelsWithVariants, ({ selectedVariantsIds }, channelId) => {
const { name } = channels.find(getById(channelId));
const filteredChannel = channels.find(getById(channelId));
if (!filteredChannel) {
return null;
}
const { name } = filteredChannel;
const isVariantSelected = (variantId: string) =>
selectedVariantsIds.includes(variantId);