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
|
const store = rootState
|
||||||
.set('me', '1')
|
.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(
|
const renderComponentWithChatContext = () => render(
|
||||||
<VirtuosoMockContext.Provider value={{ viewportHeight: 300, itemHeight: 100 }}>
|
<VirtuosoMockContext.Provider value={{ viewportHeight: 300, itemHeight: 100 }}>
|
||||||
|
|
|
@ -208,7 +208,7 @@ const ChatMessage = (props: IChatMessage) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{!features.chatEmojiReactions ? (
|
{features.chatEmojiReactions && (
|
||||||
<ChatMessageReactionWrapper
|
<ChatMessageReactionWrapper
|
||||||
onOpen={setIsReactionSelectorOpen}
|
onOpen={setIsReactionSelectorOpen}
|
||||||
onSelect={(emoji) => createReaction.mutate({ emoji, messageId: chatMessage.id, chatMessage })}
|
onSelect={(emoji) => createReaction.mutate({ emoji, messageId: chatMessage.id, chatMessage })}
|
||||||
|
@ -226,7 +226,7 @@ const ChatMessage = (props: IChatMessage) => {
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
</ChatMessageReactionWrapper>
|
</ChatMessageReactionWrapper>
|
||||||
) : null}
|
)}
|
||||||
|
|
||||||
{menu.length > 0 && (
|
{menu.length > 0 && (
|
||||||
<DropdownMenu
|
<DropdownMenu
|
||||||
|
@ -307,7 +307,7 @@ const ChatMessage = (props: IChatMessage) => {
|
||||||
</Stack>
|
</Stack>
|
||||||
</HStack>
|
</HStack>
|
||||||
|
|
||||||
{(features.chatEmojiReactions && chatMessage.emoji_reactions) ? (
|
{(chatMessage.emoji_reactions?.size) ? (
|
||||||
<div
|
<div
|
||||||
className={clsx({
|
className={clsx({
|
||||||
'space-y-1': true,
|
'space-y-1': true,
|
||||||
|
|
|
@ -20,7 +20,7 @@ export const ChatMessageRecord = ImmutableRecord({
|
||||||
created_at: '',
|
created_at: '',
|
||||||
emojis: ImmutableList<Emoji>(),
|
emojis: ImmutableList<Emoji>(),
|
||||||
expiration: null as number | null,
|
expiration: null as number | null,
|
||||||
emoji_reactions: ImmutableList<EmojiReaction>(),
|
emoji_reactions: null as ImmutableList<EmojiReaction> | null,
|
||||||
id: '',
|
id: '',
|
||||||
unread: false,
|
unread: false,
|
||||||
deleting: false,
|
deleting: false,
|
||||||
|
|
|
@ -82,6 +82,9 @@ export const GLITCH = 'glitch';
|
||||||
// NOTE: Rebased is named 'soapbox' for legacy reasons.
|
// NOTE: Rebased is named 'soapbox' for legacy reasons.
|
||||||
export const REBASED = 'soapbox';
|
export const REBASED = 'soapbox';
|
||||||
|
|
||||||
|
/** Backend name reserved only for tests. */
|
||||||
|
export const UNRELEASED = 'unreleased';
|
||||||
|
|
||||||
/** Parse features for the given instance */
|
/** Parse features for the given instance */
|
||||||
const getInstanceFeatures = (instance: Instance) => {
|
const getInstanceFeatures = (instance: Instance) => {
|
||||||
const v = parseVersion(instance.version);
|
const v = parseVersion(instance.version);
|
||||||
|
@ -251,7 +254,7 @@ const getInstanceFeatures = (instance: Instance) => {
|
||||||
/**
|
/**
|
||||||
* Ability to add reactions to chat messages.
|
* Ability to add reactions to chat messages.
|
||||||
*/
|
*/
|
||||||
chatEmojiReactions: false, // v.software === TRUTHSOCIAL,
|
chatEmojiReactions: v.software === TRUTHSOCIAL && v.build === UNRELEASED,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pleroma chats API.
|
* Pleroma chats API.
|
||||||
|
|
Loading…
Reference in New Issue