From fed10012e466187d8560fa558e4604d7331795ac Mon Sep 17 00:00:00 2001 From: KMY Date: Mon, 27 Feb 2023 17:31:45 +0900 Subject: [PATCH] Remove emoji reactions view by notification --- app/javascript/mastodon/actions/notifications.js | 2 ++ app/javascript/mastodon/components/status.jsx | 3 ++- .../features/notifications/components/notification.jsx | 8 +++++++- app/serializers/rest/instance_serializer.rb | 4 +--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/javascript/mastodon/actions/notifications.js b/app/javascript/mastodon/actions/notifications.js index 2c63a10e5..2674405d2 100644 --- a/app/javascript/mastodon/actions/notifications.js +++ b/app/javascript/mastodon/actions/notifications.js @@ -142,9 +142,11 @@ const excludeTypesFromFilter = filter => { 'favourite', 'emoji_reaction', 'reblog', + 'status_reference', 'mention', 'poll', 'status', + 'list_status', 'update', 'admin.sign_up', 'admin.report', diff --git a/app/javascript/mastodon/components/status.jsx b/app/javascript/mastodon/components/status.jsx index d2258c5a8..5081f057b 100644 --- a/app/javascript/mastodon/components/status.jsx +++ b/app/javascript/mastodon/components/status.jsx @@ -204,6 +204,7 @@ class Status extends ImmutablePureComponent { }), contextType: PropTypes.string, ...WithOptionalRouterPropTypes, + withoutEmojiReactions: PropTypes.bool, }; // Avoid checking props that are functions (and whose equality will always @@ -675,7 +676,7 @@ class Status extends ImmutablePureComponent { const expanded = !status.get('hidden') || status.get('spoiler_text').length === 0; let emojiReactionsBar = null; - if (status.get('emoji_reactions')) { + if (!this.props.withoutEmojiReactions && status.get('emoji_reactions')) { const emojiReactions = status.get('emoji_reactions'); emojiReactionsBar = ; } diff --git a/app/javascript/mastodon/features/notifications/components/notification.jsx b/app/javascript/mastodon/features/notifications/components/notification.jsx index 523d4401c..c503a0a0c 100644 --- a/app/javascript/mastodon/features/notifications/components/notification.jsx +++ b/app/javascript/mastodon/features/notifications/components/notification.jsx @@ -186,6 +186,7 @@ class Notification extends ImmutablePureComponent { cachedMediaWidth={this.props.cachedMediaWidth} cacheMediaWidth={this.props.cacheMediaWidth} unread={this.props.unread} + withoutEmojiReactions={true} /> ); } @@ -214,6 +215,7 @@ class Notification extends ImmutablePureComponent { updateScrollBottom={this.props.updateScrollBottom} cachedMediaWidth={this.props.cachedMediaWidth} cacheMediaWidth={this.props.cacheMediaWidth} + withoutEmojiReactions={true} /> @@ -221,7 +223,6 @@ class Notification extends ImmutablePureComponent { } renderEmojiReaction (notification, link) { - console.dir(notification) const { intl, unread } = this.props; const emoji_reaction = notification.get('emoji_reaction'); @@ -248,6 +249,7 @@ class Notification extends ImmutablePureComponent { updateScrollBottom={this.props.updateScrollBottom} cachedMediaWidth={this.props.cachedMediaWidth} cacheMediaWidth={this.props.cacheMediaWidth} + withoutEmojiReactions={true} /> @@ -278,6 +280,7 @@ class Notification extends ImmutablePureComponent { updateScrollBottom={this.props.updateScrollBottom} cachedMediaWidth={this.props.cachedMediaWidth} cacheMediaWidth={this.props.cacheMediaWidth} + withoutEmojiReactions={true} /> @@ -313,6 +316,7 @@ class Notification extends ImmutablePureComponent { updateScrollBottom={this.props.updateScrollBottom} cachedMediaWidth={this.props.cachedMediaWidth} cacheMediaWidth={this.props.cacheMediaWidth} + withoutEmojiReactions={true} /> @@ -348,6 +352,7 @@ class Notification extends ImmutablePureComponent { updateScrollBottom={this.props.updateScrollBottom} cachedMediaWidth={this.props.cachedMediaWidth} cacheMediaWidth={this.props.cacheMediaWidth} + withoutEmojiReactions={true} /> @@ -389,6 +394,7 @@ class Notification extends ImmutablePureComponent { updateScrollBottom={this.props.updateScrollBottom} cachedMediaWidth={this.props.cachedMediaWidth} cacheMediaWidth={this.props.cacheMediaWidth} + withoutEmojiReactions={true} /> diff --git a/app/serializers/rest/instance_serializer.rb b/app/serializers/rest/instance_serializer.rb index f8f51985d..df17ef9d9 100644 --- a/app/serializers/rest/instance_serializer.rb +++ b/app/serializers/rest/instance_serializer.rb @@ -93,10 +93,9 @@ class REST::InstanceSerializer < ActiveModel::Serializer } end -<<<<<<< HEAD def feature_quote true -======= + end # for third party apps def fedibird_capabilities capabilities = [ @@ -106,7 +105,6 @@ class REST::InstanceSerializer < ActiveModel::Serializer capabilities << :profile_search unless Chewy.enabled? capabilities ->>>>>>> 5c5b42d42c (Fix third party app emoji reaction feature) end private