mirror of
https://github.com/suitenumerique/meet.git
synced 2026-07-27 04:09:26 +00:00
✨(frontend) update useCanMute hook to reflect room muting behavior
Allow non-privileged users to mute others when the everyone_can_mute configuration is unset or true. This setting is not yet customizable by room owners and will be introduced in a future update.
This commit is contained in:
committed by
aleb_the_flash
parent
388b7d172d
commit
9846a61bd0
@@ -1,7 +1,13 @@
|
||||
import { useIsAdminOrOwner } from './useIsAdminOrOwner'
|
||||
import { Participant } from 'livekit-client'
|
||||
import { useRoomData } from '@/features/rooms/livekit/hooks/useRoomData'
|
||||
|
||||
export const useCanMute = (participant: Participant) => {
|
||||
const apiRoomData = useRoomData()
|
||||
const isAdminOrOwner = useIsAdminOrOwner()
|
||||
return participant.isLocal || isAdminOrOwner
|
||||
return (
|
||||
participant.isLocal ||
|
||||
isAdminOrOwner ||
|
||||
apiRoomData?.configuration?.everyone_can_mute !== false
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user