Add copy option to triple-dot menu of messages

This commit is contained in:
Yusuf Sahin HAMZA 2023-04-22 04:52:25 +03:00 committed by Josh Perez
parent f1624705a7
commit f004e714f0
9 changed files with 61 additions and 0 deletions

View file

@ -720,6 +720,7 @@ export const getPropsForMessage = (
storyReplyContext,
textAttachment,
payment,
canCopy: canCopy(message),
canEditMessage: canEditMessage(message),
canDeleteForEveryone: canDeleteForEveryone(message),
canDownload: canDownload(message, conversationSelector),
@ -1773,6 +1774,12 @@ export function canReact(
return canReplyOrReact(message, ourConversationId, conversation);
}
export function canCopy(
message: Pick<MessageWithUIFieldsType, 'body' | 'deletedForEveryone'>
): boolean {
return !message.deletedForEveryone && Boolean(message.body);
}
export function canDeleteForEveryone(
message: Pick<
MessageWithUIFieldsType,