TP-22455 | notification fixes (#213)
This commit is contained in:
committed by
GitHub Enterprise
parent
d0c8ce6509
commit
cf994f46e4
@@ -91,12 +91,14 @@ const NotificationsSlice = createSlice({
|
||||
},
|
||||
addActionToNotifications: (state, action) => {
|
||||
const actionPayload = action.payload;
|
||||
let readNotificationCount = 0;
|
||||
actionPayload.forEach((action: INotificationAction) => {
|
||||
const { id } = action;
|
||||
const index = state.data.findIndex(
|
||||
notification => notification.id === id,
|
||||
);
|
||||
if (index !== -1) {
|
||||
readNotificationCount++;
|
||||
state.data[index].actions = [
|
||||
{
|
||||
widgetStatus: WidgetStatus.CLICKED,
|
||||
@@ -104,6 +106,7 @@ const NotificationsSlice = createSlice({
|
||||
];
|
||||
}
|
||||
});
|
||||
state.totalUnreadElements = state.totalUnreadElements - readNotificationCount;
|
||||
state.notificationsWithActions = [];
|
||||
},
|
||||
setNotificationsLoading: (state, action) => {
|
||||
|
||||
Reference in New Issue
Block a user