1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-21 01:59:10 +09:00
YuruToot/app/javascript/mastodon/reducers/markers.ts
2024-03-27 12:47:09 +00:00

19 lines
473 B
TypeScript

import { createReducer } from '@reduxjs/toolkit';
import { submitMarkersAction } from 'mastodon/actions/markers';
const initialState = {
home: '0',
notifications: '0',
};
export const markersReducer = createReducer(initialState, (builder) => {
builder.addCase(
submitMarkersAction.fulfilled,
(state, { payload: { home, notifications } }) => {
if (home) state.home = home;
if (notifications) state.notifications = notifications;
},
);
});