From 960b21edc1eb78b27b43ad7c01ad40a2b74348af Mon Sep 17 00:00:00 2001 From: Noa Himesaka Date: Sat, 11 Nov 2023 23:46:44 +0900 Subject: [PATCH] fix build, take 5 --- .../mastodon/components/status_action_bar.jsx | 11 ------ .../features/status/components/action_bar.jsx | 7 ---- app/javascript/mastodon/reducers/settings.js | 1 - app/javascript/mastodon/reducers/statuses.js | 37 ------------------- 4 files changed, 56 deletions(-) diff --git a/app/javascript/mastodon/components/status_action_bar.jsx b/app/javascript/mastodon/components/status_action_bar.jsx index 4b395118c2..db1d1e8b51 100644 --- a/app/javascript/mastodon/components/status_action_bar.jsx +++ b/app/javascript/mastodon/components/status_action_bar.jsx @@ -385,17 +385,6 @@ class StatusActionBar extends ImmutablePureComponent { ); - const canReact = signedIn && status.get('reactions').filter(r => r.get('count') > 0 && r.get('me')).size < maxReactions; - const reactButton = ( - - ); - const isReply = status.get('in_reply_to_account_id') === status.getIn(['account', 'id']); const canReact = signedIn && status.get('reactions').filter(r => r.get('count') > 0 && r.get('me')).size < maxReactions; const reactButton = ( diff --git a/app/javascript/mastodon/features/status/components/action_bar.jsx b/app/javascript/mastodon/features/status/components/action_bar.jsx index 418da6ab13..515ef6a218 100644 --- a/app/javascript/mastodon/features/status/components/action_bar.jsx +++ b/app/javascript/mastodon/features/status/components/action_bar.jsx @@ -201,11 +201,7 @@ class ActionBar extends PureComponent { navigator.clipboard.writeText(url); }; -<<<<<<< HEAD - handleNoOp = () => {} // hack for reaction add button -======= handleNoOp = () => {}; // hack for reaction add button ->>>>>>> pr2462 render () { const { status, relationship, intl } = this.props; @@ -300,10 +296,7 @@ class ActionBar extends PureComponent { title={intl.formatMessage(messages.react)} disabled={!canReact} icon='plus' -<<<<<<< HEAD -======= iconComponent={AddIcon} ->>>>>>> pr2462 /> ); diff --git a/app/javascript/mastodon/reducers/settings.js b/app/javascript/mastodon/reducers/settings.js index 67197fa25f..4e6e044b16 100644 --- a/app/javascript/mastodon/reducers/settings.js +++ b/app/javascript/mastodon/reducers/settings.js @@ -73,7 +73,6 @@ const initialState = ImmutableMap({ favourite: true, reaction: true, reblog: true, - reaction: true, mention: true, poll: true, status: true, diff --git a/app/javascript/mastodon/reducers/statuses.js b/app/javascript/mastodon/reducers/statuses.js index 1050aaf7e0..cc4960a548 100644 --- a/app/javascript/mastodon/reducers/statuses.js +++ b/app/javascript/mastodon/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) {