Merge pull request #1346 from mirumee/SALEOR-4278/3.1/product-view-channel-search-fix

fix dashboard crash when using the channel selector in product view
This commit is contained in:
SektorDV 2021-08-31 13:20:44 +02:00 committed by GitHub
commit f84154648b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);