From ecc9f4a1542a9bf04061815e1c10fe891d207acc Mon Sep 17 00:00:00 2001 From: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:22:32 +1000 Subject: [PATCH] Apply suggested clean up from review --- .../patterns/src/components/rename-pattern-category-modal.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/patterns/src/components/rename-pattern-category-modal.js b/packages/patterns/src/components/rename-pattern-category-modal.js index 9e0b3de6117ccb..e4015f259246b2 100644 --- a/packages/patterns/src/components/rename-pattern-category-modal.js +++ b/packages/patterns/src/components/rename-pattern-category-modal.js @@ -44,8 +44,6 @@ export default function RenamePatternCategoryModal( { try { setIsSaving( true ); - setName( '' ); - onClose?.(); // User pattern category properties may differ as they can be // normalized for use alongside template part areas, core pattern @@ -63,6 +61,7 @@ export default function RenamePatternCategoryModal( { invalidateResolution( 'getUserPatternCategories' ); onSuccess?.( savedRecord ); + onClose(); createSuccessNotice( __( 'Pattern category renamed.' ), { type: 'snackbar', @@ -81,7 +80,7 @@ export default function RenamePatternCategoryModal( { }; const onRequestClose = () => { - onClose?.(); + onClose(); setName( '' ); };