CYS: Hide shuffle button when only one pattern is available (#49790)

* CYS: Hide shuffle button when only one pattern is available

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Luigi Teschio 2024-07-23 11:43:01 +02:00 committed by GitHub
parent 7f390a3663
commit 859fd9f001
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -106,7 +106,8 @@ export default function Shuffle( { clientId }: { clientId: string } ) {
// @ts-expect-error missing type // @ts-expect-error missing type
const { replaceBlocks } = useDispatch( blockEditorStore ); const { replaceBlocks } = useDispatch( blockEditorStore );
if ( patterns.length === 0 ) { // We need at least two patterns to shuffle.
if ( patterns.length < 2 ) {
return null; return null;
} }

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
CYS: Hide shuffle button when only one pattern is available