Merge branch 'dev' into 'dev'

Fixed room settings button didn't show for Moderator

See merge request nitro/nitro-react!29
This commit is contained in:
Bill 2022-03-20 20:17:28 +00:00
commit 816c2add65

View File

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