Fixed room settings button didn't show for Moderator

This commit is contained in:
robbis95 2022-03-20 16:05:40 +01:00
parent c8fe1934f1
commit dd03ab7d93

View File

@ -20,13 +20,15 @@ export const NavigatorRoomInfoView: FC<NavigatorRoomInfoViewProps> = props =>
const [ isRoomPicked, setIsRoomPicked ] = useState(false); const [ isRoomPicked, setIsRoomPicked ] = useState(false);
const [ isRoomMuted, setIsRoomMuted ] = useState(false); const [ isRoomMuted, setIsRoomMuted ] = useState(false);
const { navigatorData = null } = useNavigatorContext(); const { navigatorData = null } = useNavigatorContext();
const isMod = GetSessionDataManager().isModerator;
const hasPermission = (permission: string) => const hasPermission = (permission: string) =>
{ {
switch(permission) switch(permission)
{ {
case 'settings': case 'settings':
return (GetSessionDataManager().userId === navigatorData.enteredGuestRoom.ownerId); return (GetSessionDataManager().userId === navigatorData.enteredGuestRoom.ownerId || isMod );
case 'staff_pick': case 'staff_pick':
return GetSessionDataManager().securityLevel >= SecurityLevel.COMMUNITY; return GetSessionDataManager().securityLevel >= SecurityLevel.COMMUNITY;
default: return false; default: return false;