From 2a64c4d028d86650fee77c5516e24085f7b9c928 Mon Sep 17 00:00:00 2001 From: fef Date: Sun, 4 Dec 2022 08:47:24 +0000 Subject: [PATCH] also disable reaction buttons in vanilla flavour --- .../mastodon/components/status_action_bar.jsx | 2 +- .../mastodon/components/status_reactions.js | 11 +++++++---- .../features/status/components/action_bar.jsx | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/javascript/mastodon/components/status_action_bar.jsx b/app/javascript/mastodon/components/status_action_bar.jsx index 503558fe23..8f328f1d7e 100644 --- a/app/javascript/mastodon/components/status_action_bar.jsx +++ b/app/javascript/mastodon/components/status_action_bar.jsx @@ -370,7 +370,7 @@ class StatusActionBar extends ImmutablePureComponent { ); - const canReact = status.get('reactions').filter(r => r.get('count') > 0 && r.get('me')).size < maxReactions; + const canReact = signedIn && status.get('reactions').filter(r => r.get('count') > 0 && r.get('me')).size < maxReactions; const reactButton = ( { const { reaction, statusId, addReaction, removeReaction } = this.props; + const { signedIn } = this.context.identity; - if (reaction.get('me')) { - removeReaction(statusId, reaction.get('name')); - } else { - addReaction(statusId, reaction.get('name')); + if (signedIn) { + if (reaction.get('me')) { + removeReaction(statusId, reaction.get('name')); + } else { + addReaction(statusId, reaction.get('name')); + } } } diff --git a/app/javascript/mastodon/features/status/components/action_bar.jsx b/app/javascript/mastodon/features/status/components/action_bar.jsx index 4ab5cdee14..989037c475 100644 --- a/app/javascript/mastodon/features/status/components/action_bar.jsx +++ b/app/javascript/mastodon/features/status/components/action_bar.jsx @@ -268,7 +268,7 @@ class ActionBar extends React.PureComponent { } } - const canReact = status.get('reactions').filter(r => r.get('count') > 0 && r.get('me')).size < maxReactions; + const canReact = signedIn && status.get('reactions').filter(r => r.get('count') > 0 && r.get('me')).size < maxReactions; const reactButton = (