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;
|
onClose?: () => void;
|
||||||
}
|
}
|
||||||
>(({ room, mEvent, onClose, ...props }, ref) => {
|
>(({ room, mEvent, onClose, ...props }, ref) => {
|
||||||
|
const mx = useMatrixClient();
|
||||||
const pinnedEvents = useRoomPinnedEvents(room);
|
const pinnedEvents = useRoomPinnedEvents(room);
|
||||||
const isPinned = pinnedEvents.includes(mEvent.getId() ?? '');
|
const isPinned = pinnedEvents.includes(mEvent.getId() ?? '');
|
||||||
const handlePin = () => {
|
const handlePin = () => {
|
||||||
@@ -767,6 +768,7 @@ export const Message = React.memo(
|
|||||||
},
|
},
|
||||||
ref,
|
ref,
|
||||||
) => {
|
) => {
|
||||||
|
const mx = useMatrixClient();
|
||||||
const useAuthentication = useMediaAuthentication();
|
const useAuthentication = useMediaAuthentication();
|
||||||
const senderId = mEvent.getSender() ?? '';
|
const senderId = mEvent.getSender() ?? '';
|
||||||
const readPositions = useReadPositions();
|
const readPositions = useReadPositions();
|
||||||
@@ -1272,6 +1274,7 @@ export const Event = React.memo(
|
|||||||
ref,
|
ref,
|
||||||
) => {
|
) => {
|
||||||
const [hover, setHover] = useState(false);
|
const [hover, setHover] = useState(false);
|
||||||
|
const mx = useMatrixClient();
|
||||||
const { hoverProps } = useHover({ onHoverChange: setHover });
|
const { hoverProps } = useHover({ onHoverChange: setHover });
|
||||||
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setHover });
|
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setHover });
|
||||||
const [menuAnchor, setMenuAnchor] = useState<RectCords>();
|
const [menuAnchor, setMenuAnchor] = useState<RectCords>();
|
||||||
|
|||||||
Reference in New Issue
Block a user