nas/app/javascript/mastodon/reducers/reaction_deck.js
2023-05-26 15:15:48 +09:00

13 lines
466 B
JavaScript

import { List as ImmutableList, fromJS as ConvertToImmutable } from 'immutable';
import { REACTION_DECK_FETCH_SUCCESS, REACTION_DECK_UPDATE_SUCCESS } from '../actions/reaction_deck';
const initialState = ImmutableList([]);
export default function reaction_deck(state = initialState, action) {
if(action.type === REACTION_DECK_FETCH_SUCCESS || action.type === REACTION_DECK_UPDATE_SUCCESS) {
state = ConvertToImmutable(action.emojis);
}
return state;
}