diff --git a/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx b/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx index ed7d019072..2e8b9a0c80 100644 --- a/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx +++ b/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx @@ -114,7 +114,9 @@ function NotificationTemplatesList({ i18n }) { }, []); const removeTestToast = notificationId => { - setTestToasts(testToasts.filter(toast => toast.id !== notificationId)); + setTestToasts(oldToasts => + oldToasts.filter(toast => toast.id !== notificationId) + ); }; const canAdd = actions && actions.POST;