Skip to content

Commit

Permalink
Move closeModal into finally block
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Nov 27, 2024
1 parent d486bac commit 8bacdbb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const SetAsHomepageModal = ( { items, closeModal } ) => {
show_on_front: 'page',
} );

closeModal?.();
createSuccessNotice( __( 'Homepage updated' ), {
type: 'snackbar',
} );
Expand All @@ -76,6 +75,8 @@ const SetAsHomepageModal = ( { items, closeModal } ) => {
? typedError.message
: __( 'An error occurred while setting the homepage' );
createErrorNotice( errorMessage, { type: 'snackbar' } );
} finally {
closeModal?.();
}
}

Expand Down

0 comments on commit 8bacdbb

Please sign in to comment.