Skip to content

Commit

Permalink
Lodash: Remove from Gallery block (#50591)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored May 17, 2023
1 parent 83a33e7 commit 522e1f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
7 changes: 1 addition & 6 deletions packages/block-library/src/gallery/v1/edit.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* External dependencies
*/
import { isEmpty } from 'lodash';

/**
* WordPress dependencies
*/
Expand Down Expand Up @@ -385,7 +380,7 @@ function GalleryEdit( props ) {
}

const imageSizeOptions = getImagesSizeOptions();
const shouldShowSizeOptions = hasImages && ! isEmpty( imageSizeOptions );
const shouldShowSizeOptions = hasImages && imageSizeOptions.length > 0;

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
ScrollView,
TouchableWithoutFeedback,
} from 'react-native';
import { isEmpty } from 'lodash';

/**
* WordPress dependencies
Expand Down Expand Up @@ -334,7 +333,7 @@ class GalleryImage extends Component {
accessibilityLabelImageContainer() {
const { caption, 'aria-label': ariaLabel } = this.props;

return isEmpty( caption )
return ! caption
? ariaLabel
: ariaLabel +
'. ' +
Expand Down

1 comment on commit 522e1f1

@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 522e1f1.
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/5001108201
📝 Reported issues:

Please sign in to comment.