(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:
lebaudantoine
2026-03-24 19:27:24 +01:00
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
)
}