Skip to content
Snippets Groups Projects
Commit 2cbd4a7f authored by Florent POITTEVIN's avatar Florent POITTEVIN
Browse files

fix: 1463 making a notification as read or unread should update the notification counter

parent 197c094d
No related branches found
No related tags found
No related merge requests found
...@@ -246,6 +246,7 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati ...@@ -246,6 +246,7 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati
} else if (notificationCategory === Enums.Notification.CategoryEnum.INFO) { } else if (notificationCategory === Enums.Notification.CategoryEnum.INFO) {
this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRead.success")); this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRead.success"));
} }
SessionStorageHelper.removeItemInList(SessionStorageEnum.notificationInboxPending, (action.parentAction as PreservationSpaceNotificationAction.SetProcessed).notificationId);
} }
@Action(PreservationSpaceNotificationAction.SetProcessedFail) @Action(PreservationSpaceNotificationAction.SetProcessedFail)
...@@ -274,6 +275,7 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati ...@@ -274,6 +275,7 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati
setRefuseSuccess(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.SetRefuseSuccess): void { setRefuseSuccess(ctx: StateContext<PreservationSpaceNotificationStateModel>, action: PreservationSpaceNotificationAction.SetRefuseSuccess): void {
this.removeNotificationPendingListAndRefresh(ctx, (action.parentAction as PreservationSpaceNotificationAction.SetRefuse).notificationId, (action.parentAction as PreservationSpaceNotificationAction.SetRefuse).mode); this.removeNotificationPendingListAndRefresh(ctx, (action.parentAction as PreservationSpaceNotificationAction.SetRefuse).notificationId, (action.parentAction as PreservationSpaceNotificationAction.SetRefuse).mode);
this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRefuse.success")); this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setRefuse.success"));
SessionStorageHelper.removeItemInList(SessionStorageEnum.notificationInboxPending, (action.parentAction as PreservationSpaceNotificationAction.SetRefuse).notificationId);
} }
@Action(PreservationSpaceNotificationAction.SetRefuseFail) @Action(PreservationSpaceNotificationAction.SetRefuseFail)
...@@ -302,6 +304,7 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati ...@@ -302,6 +304,7 @@ export class PreservationSpaceNotificationState extends ResourceState<Preservati
} else if (notificationCategory === Enums.Notification.CategoryEnum.INFO) { } else if (notificationCategory === Enums.Notification.CategoryEnum.INFO) {
this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setUnread.success")); this.notificationService.showSuccess(MARK_AS_TRANSLATABLE("preservationSpace.notifications.setUnread.success"));
} }
SessionStorageHelper.addItemInList(SessionStorageEnum.notificationInboxPending, (action.parentAction as PreservationSpaceNotificationAction.SetPending).notificationId);
} }
private removeNotificationPendingListAndRefresh(ctx: StateContext<PreservationSpaceNotificationStateModel>, private removeNotificationPendingListAndRefresh(ctx: StateContext<PreservationSpaceNotificationStateModel>,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment