0
0
Fork 0

Rewrite markers reducer in Typescript (#27644)

This commit is contained in:
Renaud Chaput 2024-03-27 13:47:09 +01:00 committed by GitHub
parent d49343ed11
commit 27d014a7fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 202 additions and 185 deletions

View file

@ -13,7 +13,7 @@ import {
unfocusApp,
} from '../actions/app';
import {
MARKERS_FETCH_SUCCESS,
fetchMarkers,
} from '../actions/markers';
import {
notificationsUpdate,
@ -255,8 +255,8 @@ const recountUnread = (state, last_read_id) => {
export default function notifications(state = initialState, action) {
switch(action.type) {
case MARKERS_FETCH_SUCCESS:
return action.markers.notifications ? recountUnread(state, action.markers.notifications.last_read_id) : state;
case fetchMarkers.fulfilled.type:
return action.payload.markers.notifications ? recountUnread(state, action.payload.markers.notifications.last_read_id) : state;
case NOTIFICATIONS_MOUNT:
return updateMounted(state);
case NOTIFICATIONS_UNMOUNT: