mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 14:40:50 +01:00
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:
commit
816c2add65
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user