Skip to content

Commit

Permalink
Site Logo: Simplify method for getting block editor settings (#47736)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Feb 3, 2023
1 parent 4051e86 commit 12fcb43
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/block-library/src/site-logo/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,15 @@ const SiteLogo = ( {
'is-transient': isBlobURL( logoUrl ),
} );
const { imageEditing, maxWidth, title } = useSelect( ( select ) => {
const { getSettings } = select( blockEditorStore );
const settings = select( blockEditorStore ).getSettings();
const siteEntities = select( coreStore ).getEntityRecord(
'root',
'__unstableBase'
);
return {
title: siteEntities?.name,
...Object.fromEntries(
Object.entries( getSettings() ).filter( ( [ key ] ) =>
[ 'imageEditing', 'maxWidth' ].includes( key )
)
),
imageEditing: settings.imageEditing,
maxWidth: settings.maxWidth,
};
}, [] );

Expand Down

1 comment on commit 12fcb43

@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 12fcb43.
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/4084812129
📝 Reported issues:

Please sign in to comment.