diff --git a/app/soapbox/features/chats/components/__tests__/chat-message-list.test.tsx b/app/soapbox/features/chats/components/__tests__/chat-message-list.test.tsx index 1feead076..d538bee34 100644 --- a/app/soapbox/features/chats/components/__tests__/chat-message-list.test.tsx +++ b/app/soapbox/features/chats/components/__tests__/chat-message-list.test.tsx @@ -71,7 +71,7 @@ Object.assign(navigator, { const store = rootState .set('me', '1') - .set('instance', normalizeInstance({ version: '3.4.1 (compatible; TruthSocial 1.0.0)' })); + .set('instance', normalizeInstance({ version: '3.4.1 (compatible; TruthSocial 1.0.0+unreleased)' })); const renderComponentWithChatContext = () => render( diff --git a/app/soapbox/features/chats/components/chat-message.tsx b/app/soapbox/features/chats/components/chat-message.tsx index a64989f5f..597c78ef1 100644 --- a/app/soapbox/features/chats/components/chat-message.tsx +++ b/app/soapbox/features/chats/components/chat-message.tsx @@ -208,7 +208,7 @@ const ChatMessage = (props: IChatMessage) => { }) } > - {!features.chatEmojiReactions ? ( + {features.chatEmojiReactions && ( createReaction.mutate({ emoji, messageId: chatMessage.id, chatMessage })} @@ -226,7 +226,7 @@ const ChatMessage = (props: IChatMessage) => { /> - ) : null} + )} {menu.length > 0 && ( { - {(features.chatEmojiReactions && chatMessage.emoji_reactions) ? ( + {(chatMessage.emoji_reactions?.size) ? (
(), expiration: null as number | null, - emoji_reactions: ImmutableList(), + emoji_reactions: null as ImmutableList | null, id: '', unread: false, deleting: false, diff --git a/app/soapbox/utils/features.ts b/app/soapbox/utils/features.ts index 20bbc83fe..69ae78fcd 100644 --- a/app/soapbox/utils/features.ts +++ b/app/soapbox/utils/features.ts @@ -82,6 +82,9 @@ export const GLITCH = 'glitch'; // NOTE: Rebased is named 'soapbox' for legacy reasons. export const REBASED = 'soapbox'; +/** Backend name reserved only for tests. */ +export const UNRELEASED = 'unreleased'; + /** Parse features for the given instance */ const getInstanceFeatures = (instance: Instance) => { const v = parseVersion(instance.version); @@ -251,7 +254,7 @@ const getInstanceFeatures = (instance: Instance) => { /** * Ability to add reactions to chat messages. */ - chatEmojiReactions: false, // v.software === TRUTHSOCIAL, + chatEmojiReactions: v.software === TRUTHSOCIAL && v.build === UNRELEASED, /** * Pleroma chats API.