improvement: task assignment notif added to notifications feature.
This commit is contained in:
@@ -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':
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user