mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Check Notification Test Status
This commit is contained in:
@@ -11,11 +11,13 @@ import Loading from '@/components/Loading';
|
||||
export const NotificationSettings = ({ onError, onSuccess }: { onError: (message: string) => void, onSuccess: (message: string) => void }) => {
|
||||
const { loadNotifications, notifications, loading, testNotification } = useNotifications();
|
||||
const [deleteNotificationId, setDeleteNotificationId] = useState<number | null>(null);
|
||||
const [notificationTestId, setNotificationTestId] = useState<number | null>(null);
|
||||
|
||||
|
||||
const testNotificationHandler = async (notificationProviderId: number) => {
|
||||
(document.getElementById('test_notification') as HTMLDialogElement)?.showModal();
|
||||
await testNotification(notificationProviderId);
|
||||
const notificationTest = await testNotification(notificationProviderId);
|
||||
setNotificationTestId(notificationTest.id);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -79,7 +81,9 @@ export const NotificationSettings = ({ onError, onSuccess }: { onError: (message
|
||||
{deleteNotificationId && (
|
||||
<DeleteNotification notificationId={deleteNotificationId} onNotificationDeleted={loadNotifications} onError={onError} onSuccess={onSuccess} />
|
||||
)}
|
||||
<TestNotification />
|
||||
{notificationTestId && (
|
||||
<TestNotification notificationTestId={notificationTestId} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user