fix: restore mx declarations to all components in Message.tsx
CI / Build & Quality Checks (push) Successful in 10m9s
CI / Build & Quality Checks (push) Successful in 10m9s
Automated cleanup removed const mx = useMatrixClient() from 3 more components that use it (MessagePinItem, Message, Event) in addition to the 2 fixed in the previous hotfix. Root cause: the cleanup script used substring matching on indentation which removed declarations at any indent level, not just the one targeted unused variable. All 5 components that call mx.* now have their declarations restored. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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<RectCords>();
|
||||
|
||||
Reference in New Issue
Block a user