Skip to content

Commit

Permalink
test: Fix potential issue caused by conditional operators - refs #254220
Browse files Browse the repository at this point in the history
  • Loading branch information
dana-cfc4 committed Jun 29, 2023
1 parent a46e16d commit 0a1e397
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/SearchBlock/BlockContainer/BlockContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ export default function BlockContainer(props) {
[],
);

if (mode !== 'view')
if (mode === 'view')
return data ? (
<RenderBlocks content={content} metadata={metadata} location={location} />
) : null;
else
return data ? (
<BlockEdit
id={block}
Expand Down Expand Up @@ -66,11 +70,4 @@ export default function BlockContainer(props) {
<NewBlockAddButton block={block} onMutateBlock={onChangeSlotfill} />
</div>
);

return (
mode === 'view' &&
(data ? (
<RenderBlocks content={content} metadata={metadata} location={location} />
) : null)
);
}

0 comments on commit 0a1e397

Please sign in to comment.