From 04fa964a103092abbb89552ad900355646b81669 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 420798e2f..08e79d283 100644 --- a/app/javascript/mastodon/components/status_action_bar.jsx +++ b/app/javascript/mastodon/components/status_action_bar.jsx @@ -374,7 +374,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 cc68302a9..867412221 100644 --- a/app/javascript/mastodon/features/status/components/action_bar.jsx +++ b/app/javascript/mastodon/features/status/components/action_bar.jsx @@ -273,7 +273,7 @@ class ActionBar extends 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 = (