big update

This commit is contained in:
Iliyan Angelov
2025-12-12 01:48:04 +02:00
parent d4c6ae8aec
commit 7acf05e186
249 changed files with 3395 additions and 10087 deletions

View File

@@ -78,6 +78,7 @@ const InAppNotificationBell: React.FC = () => {
intervalRef.current = null;
}
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isAuthenticated, token]);
const loadNotifications = async () => {
@@ -107,11 +108,11 @@ const InAppNotificationBell: React.FC = () => {
try {
await notificationService.markAsRead(notificationId);
setNotifications(notifications.map(n =>
n.id === notificationId ? { ...n, status: 'read' as any, read_at: new Date().toISOString() } : n
n.id === notificationId ? { ...n, status: 'read' as 'unread' | 'read', read_at: new Date().toISOString() } : n
));
setUnreadCount(Math.max(0, unreadCount - 1));
} catch (error: any) {
toast.error(error.message || 'Failed to mark as read');
} catch (error: unknown) {
toast.error(getUserFriendlyError(error) || 'Failed to mark as read');
}
};
@@ -120,10 +121,10 @@ const InAppNotificationBell: React.FC = () => {
setLoading(true);
const unread = notifications.filter(n => !n.read_at);
await Promise.all(unread.map(n => notificationService.markAsRead(n.id)));
setNotifications(notifications.map(n => ({ ...n, status: 'read' as any, read_at: new Date().toISOString() })));
setNotifications(notifications.map(n => ({ ...n, status: 'read' as 'read' | 'unread', read_at: new Date().toISOString() })));
setUnreadCount(0);
} catch (error: any) {
toast.error(error.message || 'Failed to mark all as read');
} catch (error: unknown) {
toast.error(getUserFriendlyError(error) || 'Failed to mark all as read');
} finally {
setLoading(false);
}