improvement: task assignment notif added to notifications feature.

This commit is contained in:
2026-07-18 17:23:47 +03:30
parent 9941dca849
commit 408b2c3329
16 changed files with 76 additions and 18 deletions

View File

@@ -35,6 +35,12 @@ export function formatLabCaseActivityLine(
actor,
date,
});
case 'TASK_ASSIGNED':
return t('activityTaskAssigned', {
step: activity.stepLabel ?? t('activityUnknownStep'),
actor,
date,
});
case 'CASE_IMPORTANT':
return t('activityCaseImportant', { actor, date });
case 'CASE_AMENDED':

View File

@@ -78,11 +78,16 @@ export function RealtimeProvider({ children }: { children: ReactNode }) {
const socket = io(`${apiOrigin()}/realtime`, {
withCredentials: true,
transports: ['websocket', 'polling'],
// Avoid hammering the gateway with an expired cookie; we reconnect after refresh.
reconnection: true,
reconnectionAttempts: 5,
reconnectionDelay: 2000,
});
socketRef.current = socket;
socket.on('connect', () => setConnected(true));
socket.on('disconnect', () => setConnected(false));
socket.on('connect_error', () => setConnected(false));
socket.on('notification.created', (payload: { notification?: UserNotificationItem }) => {
if (payload?.notification) {
setLastNotification(payload.notification);