diff --git a/app/javascript/flavours/glitch/reducers/statuses.js b/app/javascript/flavours/glitch/reducers/statuses.js index ff41a57dfe61ae..1d881b2a850bd5 100644 --- a/app/javascript/flavours/glitch/reducers/statuses.js +++ b/app/javascript/flavours/glitch/reducers/statuses.js @@ -105,43 +105,6 @@ const statusTranslateUndo = (state, id) => { }); }; -const updateReaction = (state, id, name, updater) => state.update( - id, - status => status.update( - 'reactions', - reactions => { - const index = reactions.findIndex(reaction => reaction.get('name') === name); - if (index > -1) { - return reactions.update(index, reaction => updater(reaction)); - } else { - return reactions.push(updater(fromJS({ name, count: 0 }))); - } - }, - ), -); - -const updateReactionCount = (state, reaction) => updateReaction(state, reaction.status_id, reaction.name, x => x.set('count', reaction.count)); - -// The url parameter is only used when adding a new custom emoji reaction -// (one that wasn't in the reactions list before) because we don't have its -// URL yet. In all other cases, it's undefined. -const addReaction = (state, id, name, url) => updateReaction( - state, - id, - name, - x => x.set('me', true) - .update('count', n => n + 1) - .update('url', old => old ? old : url) - .update('static_url', old => old ? old : url), -); - -const removeReaction = (state, id, name) => updateReaction( - state, - id, - name, - x => x.set('me', false).update('count', n => n - 1), -); - const initialState = ImmutableMap(); export default function statuses(state = initialState, action) {