feat: update room control widgets and menus

This commit is contained in:
Lorenzune
2026-04-03 12:09:16 +02:00
parent 60f0355a13
commit e4b1f14fa2
8 changed files with 82 additions and 29 deletions
@@ -108,8 +108,15 @@ export const ContextMenuView: FC<ContextMenuViewProps> = ({
const update = () => {
if (!elementRef.current) return;
const bounds = GetRoomObjectBounds(GetRoomSession().roomId, objectId, category);
const location = GetRoomObjectScreenLocation(GetRoomSession().roomId, objectId, category);
const roomSession = GetRoomSession();
if (!roomSession) {
onClose();
return;
}
const bounds = GetRoomObjectBounds(roomSession.roomId, objectId, category);
const location = GetRoomObjectScreenLocation(roomSession.roomId, objectId, category);
updatePosition(bounds, location);
};
@@ -117,7 +124,7 @@ export const ContextMenuView: FC<ContextMenuViewProps> = ({
ticker.add(update);
return () => ticker.remove(update);
}, [objectId, category, updatePosition]);
}, [objectId, category, updatePosition, onClose]);
useEffect(() => {
if (!fades) return;
@@ -141,4 +148,4 @@ export const ContextMenuView: FC<ContextMenuViewProps> = ({
{collapsable && <ContextMenuCaretView collapsed={isCollapsed} onClick={() => setIsCollapsed((prev) => !prev)} />}
</div>
);
};
};