Merge branch 'gate-chat-reactions' into 'develop'
Fix chatEmojiReactions feature gating See merge request soapbox-pub/soapbox!2286
This commit is contained in:
commit
78328a0ce2
|
@ -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(
|
||||
<VirtuosoMockContext.Provider value={{ viewportHeight: 300, itemHeight: 100 }}>
|
||||
|
|
|
@ -208,7 +208,7 @@ const ChatMessage = (props: IChatMessage) => {
|
|||
})
|
||||
}
|
||||
>
|
||||
{!features.chatEmojiReactions ? (
|
||||
{features.chatEmojiReactions && (
|
||||
<ChatMessageReactionWrapper
|
||||
onOpen={setIsReactionSelectorOpen}
|
||||
onSelect={(emoji) => createReaction.mutate({ emoji, messageId: chatMessage.id, chatMessage })}
|
||||
|
@ -226,7 +226,7 @@ const ChatMessage = (props: IChatMessage) => {
|
|||
/>
|
||||
</button>
|
||||
</ChatMessageReactionWrapper>
|
||||
) : null}
|
||||
)}
|
||||
|
||||
{menu.length > 0 && (
|
||||
<DropdownMenu
|
||||
|
@ -307,7 +307,7 @@ const ChatMessage = (props: IChatMessage) => {
|
|||
</Stack>
|
||||
</HStack>
|
||||
|
||||
{(features.chatEmojiReactions && chatMessage.emoji_reactions) ? (
|
||||
{(chatMessage.emoji_reactions?.size) ? (
|
||||
<div
|
||||
className={clsx({
|
||||
'space-y-1': true,
|
||||
|
|
|
@ -20,7 +20,7 @@ export const ChatMessageRecord = ImmutableRecord({
|
|||
created_at: '',
|
||||
emojis: ImmutableList<Emoji>(),
|
||||
expiration: null as number | null,
|
||||
emoji_reactions: ImmutableList<EmojiReaction>(),
|
||||
emoji_reactions: null as ImmutableList<EmojiReaction> | null,
|
||||
id: '',
|
||||
unread: false,
|
||||
deleting: false,
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue