mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-31 20:58:03 +00:00
9e0d57a8c6
`MuteButton` owned the confirmation dialog state locally. On the participant tile, the button lives inside `FadeOverlay`, which conditionally mounts its children based on tile mouse activity (3 s idle timeout). Once the user moved the pointer onto the react-aria portal, mouse events on the tile stopped, the idle timer expired, `FadeOverlay` unmounted `MuteButton`, and the dialog was destroyed with it — hence the "closes randomly" behavior. Render the dialog once at the VideoConference level via a shared `MuteAlertDialogProvider`, so its lifetime is independent from any button that opens it.
19 lines
402 B
TypeScript
19 lines
402 B
TypeScript
import { proxy, ref } from 'valtio'
|
|
import type { Participant } from 'livekit-client'
|
|
|
|
type State = {
|
|
participant: Participant | null
|
|
}
|
|
|
|
export const muteDialogStore = proxy<State>({
|
|
participant: null,
|
|
})
|
|
|
|
export const openMuteDialog = (participant: Participant) => {
|
|
muteDialogStore.participant = ref(participant)
|
|
}
|
|
|
|
export const closeMuteDialog = () => {
|
|
muteDialogStore.participant = null
|
|
}
|