Skip to content

Commit

Permalink
Fix [Feature sets] UI crash on attempt to preview feature set
Browse files Browse the repository at this point in the history
  • Loading branch information
mariana-furyk committed Dec 22, 2023
1 parent c17ec0c commit db16158
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/DetailsPreview/DetailsPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ const DetailsPreview = ({ artifact, handlePreview }) => {
const popupButtonIsDisplayed = useMemo(() => {
return (
artifact.target_path &&
(artifact.extra_data.length > 0 ||
(artifact.extra_data?.length > 0 ||
(!preview[0]?.error && !preview.every(item => item.hidden)))
)
}, [artifact.extra_data.length, artifact.target_path, preview])
}, [artifact.extra_data, artifact.target_path, preview])

const artifactsPreviewClassNames = classnames(
popupButtonIsDisplayed && 'artifact-preview__with-popout'
Expand Down Expand Up @@ -73,10 +73,10 @@ const DetailsPreview = ({ artifact, handlePreview }) => {
</div>
)}
<div className={artifactsPreviewClassNames}>
{preview[0]?.hidden && artifact.extra_data.length > 0 ? null : (
{preview[0]?.hidden && artifact.extra_data?.length > 0 ? null : (
<ArtifactsPreview noData={noData} preview={preview} />
)}
{artifact.extra_data.length > 0 && <ArtifactsExtraData artifact={artifact} />}
{artifact.extra_data?.length > 0 && <ArtifactsExtraData artifact={artifact} />}
</div>
</div>
)
Expand Down

0 comments on commit db16158

Please sign in to comment.