Skip to content

Commit

Permalink
Add snackbar notice in classifai registration settings as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed Dec 23, 2024
1 parent 1160e4e commit d9ed9f4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/js/settings/components/classifai-registration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ export const SaveSettingsButton = ( {
setSettings,
onSaveSuccess = () => {},
} ) => {
const { createErrorNotice, removeNotices } = useDispatch( noticesStore );
const { createErrorNotice, createSuccessNotice, removeNotices } =
useDispatch( noticesStore );
const notices = useSelect( ( select ) =>
select( noticesStore ).getNotices()
);
Expand Down Expand Up @@ -205,6 +206,12 @@ export const SaveSettingsButton = ( {

setSettings( res.settings );
onSaveSuccess();
createSuccessNotice(
__( 'Settings saved successfully.', 'classifai' ),
{
type: 'snackbar',
}
);
setIsSaving( false );
} )
.catch( ( error ) => {
Expand Down

0 comments on commit d9ed9f4

Please sign in to comment.