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
  • Loading branch information
Mamaduka committed Aug 5, 2024
1 parent 8b1b939 commit 9483408
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 9483408

Please sign in to comment.