From d9ed9f41e1d6030bc33db48e511ca4c19ffa9d5d Mon Sep 17 00:00:00 2001 From: Dharmesh Patel Date: Mon, 23 Dec 2024 22:26:57 +0530 Subject: [PATCH] Add snackbar notice in classifai registration settings as well. --- .../settings/components/classifai-registration/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/js/settings/components/classifai-registration/index.js b/src/js/settings/components/classifai-registration/index.js index e51f00b5e..2c9dbac86 100644 --- a/src/js/settings/components/classifai-registration/index.js +++ b/src/js/settings/components/classifai-registration/index.js @@ -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() ); @@ -205,6 +206,12 @@ export const SaveSettingsButton = ( { setSettings( res.settings ); onSaveSuccess(); + createSuccessNotice( + __( 'Settings saved successfully.', 'classifai' ), + { + type: 'snackbar', + } + ); setIsSaving( false ); } ) .catch( ( error ) => {