[Glitch] Rewrite markers reducer in Typescript

Port 27d014a7fa to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Renaud Chaput
2024-03-27 13:47:09 +01:00
committed by Claire
parent 3f61981f5d
commit 059e10e546
8 changed files with 201 additions and 185 deletions

View File

@@ -9,7 +9,7 @@ import {
rejectFollowRequestSuccess,
} from '../actions/accounts';
import {
MARKERS_FETCH_SUCCESS,
fetchMarkers,
} from '../actions/markers';
import {
NOTIFICATIONS_MOUNT,
@@ -297,8 +297,8 @@ export default function notifications(state = initialState, action) {
let st;
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: