Fix DataCenter emission calculation: VM-level processing, authentication fixes, and type safety improvements

This commit is contained in:
2025-07-22 07:35:23 +03:00
parent 28cc64a052
commit 55953ad2e2
354 changed files with 856831 additions and 2061 deletions

View File

@@ -0,0 +1,39 @@
const initialState = {
getQuickNotifications: [],
totalForQuick: 0,
notifications: [],
};
const notificationsReducer = (state = initialState, action) => {
switch (action.type) {
case "GET_QUICKNOTIFICATIONS":
return {
...state,
getQuickNotifications: action.payload.getQuickNotifications,
totalForQuick: action.payload.getQuickNotifications.filter(
(notification) => notification.read === false
).length,
};
case "GET_SETNOTIFICATIONREAD":
return {
...state,
setNotificationRead: action.payload.setNotificationRead,
//totalForQuick: state.totalForQuick >= 1 ? state.totalForQuick - 1 : 0,
};
case "GET_ALLNOTIFICATION":
return {
...state,
notifications: action.payload.getAllNotifications,
};
case "GET_NOTIFICATIONREMOVE":
return {
...state,
notificationRemove: action.payload.notificationRemove,
};
}
return state;
};
export default notificationsReducer;