update
This commit is contained in:
@@ -16,6 +16,7 @@ interface ChatMessageProps {
|
||||
isOwnMessage: boolean;
|
||||
onReplyClick?: (message: NextcloudMessage) => void;
|
||||
onReactionToggled?: (messageId: number) => void;
|
||||
reactionsOverride?: { reactions: Record<string, number>; reactionsSelf: string[] };
|
||||
}
|
||||
|
||||
function hasFileParams(params?: Record<string, any>): boolean {
|
||||
@@ -27,7 +28,7 @@ function hasPollParam(params?: Record<string, any>): boolean {
|
||||
return params?.object?.type === 'talk-poll';
|
||||
}
|
||||
|
||||
const ChatMessage: React.FC<ChatMessageProps> = ({ message, isOwnMessage, onReplyClick, onReactionToggled }) => {
|
||||
const ChatMessage: React.FC<ChatMessageProps> = ({ message, isOwnMessage, onReplyClick, onReactionToggled, reactionsOverride }) => {
|
||||
const [hovered, setHovered] = useState(false);
|
||||
const longPressTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
const hideTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
@@ -79,8 +80,8 @@ const ChatMessage: React.FC<ChatMessageProps> = ({ message, isOwnMessage, onRepl
|
||||
|
||||
const textBeforeFile = isFileMessage ? message.message.split('{file}')[0].trim() : null;
|
||||
|
||||
const reactions = message.reactions ?? {};
|
||||
const reactionsSelf = message.reactionsSelf ?? [];
|
||||
const reactions = reactionsOverride?.reactions ?? message.reactions ?? {};
|
||||
const reactionsSelf = reactionsOverride?.reactionsSelf ?? message.reactionsSelf ?? [];
|
||||
const hasReactions = Object.keys(reactions).length > 0;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user