diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index 261131b06..95db1db20 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -407,6 +407,7 @@ export const MessagePinItem = as< onClose?: () => void; } >(({ room, mEvent, onClose, ...props }, ref) => { + const mx = useMatrixClient(); const pinnedEvents = useRoomPinnedEvents(room); const isPinned = pinnedEvents.includes(mEvent.getId() ?? ''); const handlePin = () => { @@ -767,6 +768,7 @@ export const Message = React.memo( }, ref, ) => { + const mx = useMatrixClient(); const useAuthentication = useMediaAuthentication(); const senderId = mEvent.getSender() ?? ''; const readPositions = useReadPositions(); @@ -1272,6 +1274,7 @@ export const Event = React.memo( ref, ) => { const [hover, setHover] = useState(false); + const mx = useMatrixClient(); const { hoverProps } = useHover({ onHoverChange: setHover }); const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setHover }); const [menuAnchor, setMenuAnchor] = useState();