Skip to content

Commit

Permalink
Search: Remove unnecessary useEffect (#52604)
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian authored Jul 13, 2023
1 parent 179929d commit 09b083d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/block-library/src/search/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,17 @@ export default function SearchEdit( {
);
const { __unstableMarkNextChangeAsNotPersistent } =
useDispatch( blockEditorStore );
useEffect( () => {
if ( ! insertedInNavigationBlock ) return;

if ( insertedInNavigationBlock ) {
// This side-effect should not create an undo level.
__unstableMarkNextChangeAsNotPersistent();
setAttributes( {
showLabel: false,
buttonUseIcon: true,
buttonPosition: 'button-inside',
} );
}, [ insertedInNavigationBlock ] );
}

const borderRadius = style?.border?.radius;
const borderProps = useBorderProps( attributes );

Expand Down

1 comment on commit 09b083d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 09b083d.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5546017251
📝 Reported issues:

Please sign in to comment.