diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx index a70ac895..853d0fe0 100644 --- a/src/components/middle/message/Message.tsx +++ b/src/components/middle/message/Message.tsx @@ -263,6 +263,7 @@ const Message: FC = ({ const { chatId, id: messageId, threadInfo } = message; + const isLocal = isMessageLocal(message); const isOwn = isOwnMessage(message); const isScheduled = messageListType === 'scheduled' || message.isScheduled; const hasReply = isReplyMessage(message) && !shouldHideReply; @@ -352,6 +353,10 @@ const Message: FC = ({ }, [messageId, message.groupedId, toggleMessageSelection]); const handleMessageSelect = useCallback((e?: React.MouseEvent) => { + if (isLocal) { + return; + } + const params = isAlbum && album && album.messages ? { messageId, @@ -360,7 +365,7 @@ const Message: FC = ({ } : { messageId, withShift: e && e.shiftKey }; toggleMessageSelection(params); - }, [toggleMessageSelection, messageId, isAlbum, album]); + }, [isLocal, isAlbum, album, messageId, toggleMessageSelection]); const handleContainerDoubleClick = useCallback(() => { setReplyingToId({ messageId }); @@ -372,7 +377,10 @@ const Message: FC = ({ const handleMouseDown = (e: React.MouseEvent) => { preventMessageInputBlur(e); - handleBeforeContextMenu(e); + + if (!isLocal) { + handleBeforeContextMenu(e); + } }; const handleAvatarClick = useCallback(() => { @@ -581,7 +589,7 @@ const Message: FC = ({ sticker={animatedEmoji} observeIntersection={observeIntersectionForMedia} lastSyncTime={lastSyncTime} - forceLoadPreview={isMessageLocal(message)} + forceLoadPreview={isLocal} /> )} {isAlbum && ( @@ -760,7 +768,7 @@ const Message: FC = ({ onClick={isInSelectMode ? handleMessageSelect : IS_ANDROID ? handleClick : undefined} onDoubleClick={!isInSelectMode ? handleContainerDoubleClick : undefined} onMouseDown={!isInSelectMode ? handleMouseDown : undefined} - onContextMenu={!isInSelectMode ? handleContextMenu : undefined} + onContextMenu={!isInSelectMode && !isLocal ? handleContextMenu : undefined} onMouseEnter={isInDocumentGroup && !isLastInDocumentGroup ? handleDocumentGroupMouseEnter : undefined} onMouseLeave={isInDocumentGroup && !isLastInDocumentGroup ? handleDocumentGroupMouseLeave : undefined} > @@ -771,12 +779,12 @@ const Message: FC = ({ data-last-message-id={album ? album.messages[album.messages.length - 1].id : undefined} data-has-unread-mention={message.hasUnreadMention} /> - {!isInDocumentGroup && ( + {!isLocal && !isInDocumentGroup && (
{isSelected && }
)} - {isLastInDocumentGroup && ( + {!isLocal && isLastInDocumentGroup && (