From 326fa09fe1740e521bbd22e16febb100746a09f8 Mon Sep 17 00:00:00 2001 From: Vincent Wilson Date: Thu, 22 Feb 2024 11:19:05 -0500 Subject: [PATCH] Fix crash when opening / closing event feeds (#171) --- packages/web-shared/components/ContentChannel.js | 2 +- .../FeatureFeed/Features/VerticalCardListFeature.js | 4 ++-- .../components/FeatureFeedList/FeatureFeedListGrid.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/web-shared/components/ContentChannel.js b/packages/web-shared/components/ContentChannel.js index a7e5b297..f15288ce 100644 --- a/packages/web-shared/components/ContentChannel.js +++ b/packages/web-shared/components/ContentChannel.js @@ -38,7 +38,7 @@ function ContentChannel(props = {}) { title={item.node.title} summary={item.node.summary} onClick={() => handleActionPress(item)} - videoMedia={item.relatedNode?.videos[0]} + videoMedia={item.relatedNode?.videos?.[0]} /> ); })} diff --git a/packages/web-shared/components/FeatureFeed/Features/VerticalCardListFeature.js b/packages/web-shared/components/FeatureFeed/Features/VerticalCardListFeature.js index 8fad43b9..abda01e3 100644 --- a/packages/web-shared/components/FeatureFeed/Features/VerticalCardListFeature.js +++ b/packages/web-shared/components/FeatureFeed/Features/VerticalCardListFeature.js @@ -20,7 +20,7 @@ function VerticalCardListFeature(props = {}) { if (item.action === 'OPEN_URL') { analytics.track('OpenUrl', { url: item?.relatedNode?.url, - }); + }); return window.open(getURLFromType(item.relatedNode), '_blank'); } @@ -97,7 +97,7 @@ function VerticalCardListFeature(props = {}) { title={item.title} summary={item.summary} onClick={() => handleActionPress(item)} - videoMedia={item.relatedNode?.videos[0]} + videoMedia={item.relatedNode?.videos?.[0]} /> ))} diff --git a/packages/web-shared/components/FeatureFeedList/FeatureFeedListGrid.js b/packages/web-shared/components/FeatureFeedList/FeatureFeedListGrid.js index cf44152e..be70546e 100644 --- a/packages/web-shared/components/FeatureFeedList/FeatureFeedListGrid.js +++ b/packages/web-shared/components/FeatureFeedList/FeatureFeedListGrid.js @@ -49,7 +49,7 @@ function FeatureFeedListGrid(props = {}) { title={item.title} summary={item.summary} onClick={() => handleActionPress(item)} - videoMedia={item.relatedNode?.videos[0]} + videoMedia={item.relatedNode?.videos?.[0]} channelLabel={item.relatedNode?.parentItem?.title} /> ))}