From abd5828c1d5fdef4cb72ea100fc0a3b5e80e7982 Mon Sep 17 00:00:00 2001 From: Snaiker Date: Wed, 16 Mar 2022 18:31:18 +0000 Subject: [PATCH] Fix issue: room owner can see furni ids --- .../widgets/infostand/InfoStandWidgetFurniView.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/room/widgets/infostand/InfoStandWidgetFurniView.tsx b/src/components/room/widgets/infostand/InfoStandWidgetFurniView.tsx index 55def41f..9f9e43bd 100644 --- a/src/components/room/widgets/infostand/InfoStandWidgetFurniView.tsx +++ b/src/components/room/widgets/infostand/InfoStandWidgetFurniView.tsx @@ -33,6 +33,7 @@ export const InfoStandWidgetFurniView: FC = props const [ crackableHits, setCrackableHits ] = useState(0); const [ crackableTarget, setCrackableTarget ] = useState(0); const [ godMode, setGodMode ] = useState(false); + const [ canSeeFurniId, setCanSeeFurniId ] = useState(false); const [ groupName, setGroupName ] = useState(null); useEffect(() => @@ -49,6 +50,7 @@ export const InfoStandWidgetFurniView: FC = props let crackableHits = 0; let crackableTarget = 0; let godMode = false; + let canSeeFurniId = false; const isValidController = (furniData.roomControllerLevel >= RoomControllerLevel.GUEST); @@ -59,6 +61,11 @@ export const InfoStandWidgetFurniView: FC = props if(furniData.roomControllerLevel >= RoomControllerLevel.MODERATOR) godMode = true; } + + if(furniData.isAnyRoomController) + { + canSeeFurniId = true; + } if((((furniData.usagePolicy === RoomWidgetFurniInfoUsagePolicyEnum.EVERYBODY) || ((furniData.usagePolicy === RoomWidgetFurniInfoUsagePolicyEnum.CONTROLLER) && isValidController)) || ((furniData.extraParam === RoomWidgetEnumItemExtradataParameter.JUKEBOX) && isValidController)) || ((furniData.extraParam === RoomWidgetEnumItemExtradataParameter.USABLE_PRODUCT) && isValidController)) canUse = true; @@ -133,6 +140,7 @@ export const InfoStandWidgetFurniView: FC = props setCrackableHits(crackableHits); setCrackableTarget(crackableTarget); setGodMode(godMode); + setCanSeeFurniId(canSeeFurniId); setGroupName(null); }); @@ -312,7 +320,7 @@ export const InfoStandWidgetFurniView: FC = props { godMode && <>
- ID: { furniData.id } + { canSeeFurniId && ID: { furniData.id } } { (furniKeys.length > 0) && <>