diff --git a/desktop/src/features/messages/ui/MessageActionBar.tsx b/desktop/src/features/messages/ui/MessageActionBar.tsx index d483ab2219..e5a36abbbf 100644 --- a/desktop/src/features/messages/ui/MessageActionBar.tsx +++ b/desktop/src/features/messages/ui/MessageActionBar.tsx @@ -326,7 +326,7 @@ function isCustomEmojiShortcode(emoji: string) { return emoji.startsWith(":") && emoji.endsWith(":"); } -export function MessageActionBar({ +export const MessageActionBar = React.memo(function MessageActionBar({ channelId, message, onDelete, @@ -549,4 +549,6 @@ export function MessageActionBar({ ); -} +}); + +MessageActionBar.displayName = "MessageActionBar"; diff --git a/desktop/src/features/messages/ui/MessageRow.tsx b/desktop/src/features/messages/ui/MessageRow.tsx index aa7e259c03..bbd79fc925 100644 --- a/desktop/src/features/messages/ui/MessageRow.tsx +++ b/desktop/src/features/messages/ui/MessageRow.tsx @@ -153,6 +153,17 @@ export const MessageRow = React.memo( } = useReactionHandler(message, onToggleReaction); const { openReminder, activeReminderEventIds } = useRemindLater(); const hasActiveReminder = activeReminderEventIds.has(message.id); + const handleRemindLater = React.useCallback( + (msg: TimelineMessage) => { + openReminder({ + eventId: msg.id, + channelId: channelId ?? "", + preview: msg.body.slice(0, 100), + authorPubkey: msg.pubkey ?? "", + }); + }, + [channelId, openReminder], + ); const mentionNames = React.useMemo( () => resolveMentionNames(message.tags, profiles), [profiles, message.tags], @@ -446,14 +457,7 @@ export const MessageRow = React.memo( onReactionSelect={ canToggleReactions ? handleReactionSelect : undefined } - onRemindLater={(msg) => { - openReminder({ - eventId: msg.id, - channelId: channelId ?? "", - preview: msg.body.slice(0, 100), - authorPubkey: msg.pubkey ?? "", - }); - }} + onRemindLater={handleRemindLater} onReply={onReply} onUnfollowThread={onUnfollowThread} reactionErrorMessage={reactionErrorMessage}