Skip to content

Commit

Permalink
Convert to lowercase before comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Oct 25, 2023
1 parent 56a8890 commit 55a6ad7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export default function RenamePatternCategoryModal( {
// Check existing categories to avoid creating duplicates.
if (
existingCategories.patternCategories.find( ( existingCategory ) => {
return existingCategory.label === name;
return (
existingCategory.label.toLowerCase() === name.toLowerCase()
);
} )
) {
speak( __( 'This category already exists.' ), 'assertive' );
Expand Down

0 comments on commit 55a6ad7

Please sign in to comment.