Skip to content

Commit

Permalink
Data Views: Don't render action modal when there are no eligible items (
Browse files Browse the repository at this point in the history
#64250)


Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
  • Loading branch information
3 people committed Aug 7, 2024
1 parent bd9ba41 commit b3ccf22
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ function ActionWithModal< Item >( {
const onCloseModal = useCallback( () => {
setActionWithModal( undefined );
}, [ setActionWithModal ] );

if ( ! eligibleItems.length ) {
return null;
}

const label =
typeof action.label === 'string'
? action.label
Expand Down

0 comments on commit b3ccf22

Please sign in to comment.