Skip to content

Commit

Permalink
Fix: Remove unrequired nullish colalescing operator on canEditCss con…
Browse files Browse the repository at this point in the history
…ditions. (#55357)
  • Loading branch information
jorgefilipecosta authored Oct 16, 2023
1 parent 7e51b43 commit 5a04a2b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ function ScreenBlock( { name, variation } ) {
: undefined;

return {
canEditCSS:
!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,
canEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],
};
}, [] );
const currentBlockStyle = variation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ function ScreenRoot() {
hasVariations:
!! __experimentalGetCurrentThemeGlobalStylesVariations()
?.length,
canEditCSS:
!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,
canEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],
};
}, [] );

Expand Down
3 changes: 1 addition & 2 deletions packages/edit-site/src/components/global-styles/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ function GlobalStylesActionMenu() {
: undefined;

return {
canEditCSS:
!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,
canEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],
};
}, [] );
const { goTo } = useNavigator();
Expand Down
3 changes: 1 addition & 2 deletions packages/edit-site/src/hooks/commands/use-common-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ function useGlobalStylesOpenCssCommands() {
: undefined;

return {
canEditCSS:
!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,
canEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],
};
}, [] );
const { getCanvasMode } = unlock( useSelect( editSiteStore ) );
Expand Down

1 comment on commit 5a04a2b

@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 5a04a2b.
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/6533606292
📝 Reported issues:

Please sign in to comment.