Working telegram functionality

This commit is contained in:
headlesdev
2025-05-25 22:37:20 +02:00
parent a218a7f8f3
commit d982a69f4d
3 changed files with 35 additions and 6 deletions

View File

@@ -82,7 +82,7 @@ export const NotificationSettings = ({ onError, onSuccess }: { onError: (message
<DeleteNotification notificationId={deleteNotificationId} onNotificationDeleted={loadNotifications} onError={onError} onSuccess={onSuccess} />
)}
{notificationTestId && (
<TestNotification notificationTestId={notificationTestId} />
<TestNotification notificationTestId={notificationTestId} onError={onError} />
)}
</div>
</div>

View File

@@ -5,15 +5,20 @@ import { useEffect } from "react";
interface TestNotificationProps {
notificationTestId: number;
onError: (message: string) => void;
}
export default function TestNotification({ notificationTestId }: TestNotificationProps) {
export default function TestNotification({ notificationTestId, onError }: TestNotificationProps) {
const { getNotificationTest, notificationTest } = useNotifications();
const checkNotificationTest = async () => {
await getNotificationTest(notificationTestId);
try {
await getNotificationTest(notificationTestId);
} catch (error) {
onError(error as string);
}
}
useEffect(() => {
checkNotificationTest();