From 6cc8e2bb3c6bdb0b8fa3e4719a8cc4a8c5bf0c21 Mon Sep 17 00:00:00 2001 From: "Cam White (Jex)" <72230943+cmrxnn@users.noreply.github.com> Date: Sat, 9 Apr 2022 23:54:02 +0000 Subject: [PATCH] Add flash message when notifications are reset --- .../components/dashboard/AccountNotificationsContainer.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/scripts/components/dashboard/AccountNotificationsContainer.tsx b/resources/scripts/components/dashboard/AccountNotificationsContainer.tsx index fa7dc5eb42..7c8bdaafce 100644 --- a/resources/scripts/components/dashboard/AccountNotificationsContainer.tsx +++ b/resources/scripts/components/dashboard/AccountNotificationsContainer.tsx @@ -21,7 +21,7 @@ export default () => { const [ isSubmitting, setIsSubmitting ] = useState(false); const [ notifications, setNotifications ] = useState([]); - const { addError, clearFlashes } = useStoreActions((actions: Actions) => actions.flashes); + const { addError, addFlash, clearFlashes } = useStoreActions((actions: Actions) => actions.flashes); useEffect(() => { clearFlashes('account'); @@ -38,6 +38,11 @@ export default () => { setIsSubmitting(true); deleteNotifications() .then(() => setIsSubmitting(false)) + .then(() => addFlash({ + type: 'success', + key: 'account:notifications', + message: 'Notifications have been cleared, please refresh the page.', + })) .catch(error => { addError({ key: 'account:notifications', message: httpErrorToHuman(error) }); });