mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Working telegram functionality
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user