mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
fix: emoji-mart update breaks native emoji fetch, use SearchIndex
This commit is contained in:
parent
84deed19f9
commit
c60cfd8669
|
@ -102,7 +102,7 @@ export interface ConversationAttributes {
|
|||
|
||||
markedAsUnread: boolean; // Force the conversation as unread even if all the messages are read. Used to highlight a conversation the user wants to check again later, synced.
|
||||
|
||||
blocksSogsMsgReqsTimestamp: number; // if that convo is a blinded one and that user denied be contacted through sogs, this field will be set to his latest message timestamp
|
||||
blocksSogsMsgReqsTimestamp: number; // if the convo is blinded and the user has denied contact through sogs, this field be set to the user's latest message timestamp
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { AbortSignal } from 'abort-controller';
|
||||
import { getEmojiDataFromNative } from 'emoji-mart';
|
||||
import { SearchIndex } from 'emoji-mart';
|
||||
import { Data } from '../../../../data/data';
|
||||
import { ConversationModel } from '../../../../models/conversation';
|
||||
import { Action, OpenGroupReactionResponse, Reaction } from '../../../../types/Reaction';
|
||||
|
@ -68,9 +68,8 @@ export const sendSogsReactionOnionV4 = async (
|
|||
|
||||
// The SOGS endpoint supports any text input so we need to make sure we are sending a valid unicode emoji
|
||||
// for an invalid input we use https://emojipedia.org/frame-with-an-x/ as a replacement since it cannot rendered as an emoji but is valid unicode
|
||||
// NOTE emoji-mart v5.2.2 types for getEmojiDataFromNative are broken
|
||||
// eslint-disable-next-line @typescript-eslint/await-thenable
|
||||
const emoji = (await getEmojiDataFromNative(reaction.emoji)) ? reaction.emoji : '🖾';
|
||||
const emoji = (await SearchIndex.search(reaction.emoji)) ? reaction.emoji : '🖾';
|
||||
const endpoint = `/room/${room}/reaction/${reaction.id}/${emoji}`;
|
||||
const method = reaction.action === Action.REACT ? 'PUT' : 'DELETE';
|
||||
const serverPubkey = allValidRoomInfos[0].serverPublicKey;
|
||||
|
|
Loading…
Reference in a new issue