mirror of
https://github.com/suitenumerique/meet.git
synced 2026-09-04 14:45:40 +00:00
🐛(frontend) fix joined notification tile no longer rendering properly
The toast is enqueued on `ParticipantConnected`, which livekit-client fires before the participant's track publications exist. At that point `getTrackPublication(Camera)` is `undefined`, and the track ref used by the toast is frozen that way — the toast never re-subscribes to the participant. Downstream effects: * LiveKit's `useIsMuted` initializes to `false` when there is no publication, so the tile first paints with `data-lk-video-muted="false"`, which the stock CSS maps to placeholder `opacity: 0` — a blank box. * Its effect then subscribes to `mutedObserver`, which defaults to `true` for the same situation, triggering a second render and only then starting the 200 ms fade-in. That render-effect-render transition is the visible lag behind the text. * Because the track ref never updates, no `VideoTrack` ever mounts. When the camera is later subscribed, the placeholder fades out again, leaving the tile empty. Re-derive the track ref inside the toast when the participant's publications become available, so `useIsMuted` sees the real state from the start and the tile renders the video (or a stable placeholder) instead of a blank box.
This commit is contained in:
committed by
aleb_the_flash
parent
9e0d57a8c6
commit
e5f0b1c202
@@ -30,6 +30,7 @@ and this project adheres to
|
|||||||
- 🐛(frontend) use state instead of a ref for MoreControls container
|
- 🐛(frontend) use state instead of a ref for MoreControls container
|
||||||
- 🐛(frontend) stop init_virtual_background from firing on blur updates
|
- 🐛(frontend) stop init_virtual_background from firing on blur updates
|
||||||
- 🐛(frontend) hoist mute confirmation dialog to VideoConference level
|
- 🐛(frontend) hoist mute confirmation dialog to VideoConference level
|
||||||
|
- 🐛(frontend) fix joined notification tile no longer rendering properly
|
||||||
|
|
||||||
## [1.27.0] - 2026-08-14
|
## [1.27.0] - 2026-08-14
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useToast } from 'react-aria'
|
import { useToast } from 'react-aria'
|
||||||
import { useRef } from 'react'
|
import { useMemo, useRef } from 'react'
|
||||||
import { Button as RACButton } from 'react-aria-components'
|
import { Button as RACButton } from 'react-aria-components'
|
||||||
import { Track } from 'livekit-client'
|
import { Track } from 'livekit-client'
|
||||||
import Source = Track.Source
|
import Source = Track.Source
|
||||||
@@ -11,6 +11,7 @@ import { Div } from '@/primitives'
|
|||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { StyledToastContainer } from './StyledToastContainer'
|
import { StyledToastContainer } from './StyledToastContainer'
|
||||||
import { setPinnedTrack } from '@/stores/layout'
|
import { setPinnedTrack } from '@/stores/layout'
|
||||||
|
import { useParticipantTracks } from '@livekit/components-react'
|
||||||
|
|
||||||
const ClickableToast = styled(RACButton, {
|
const ClickableToast = styled(RACButton, {
|
||||||
base: {
|
base: {
|
||||||
@@ -30,13 +31,17 @@ export function ToastJoined({ state, ...props }: Readonly<ToastProps>) {
|
|||||||
)
|
)
|
||||||
const participant = props.toast.content.participant
|
const participant = props.toast.content.participant
|
||||||
|
|
||||||
if (!participant) return
|
const [cameraTrack] = useParticipantTracks(
|
||||||
|
[Source.Camera],
|
||||||
|
participant?.identity
|
||||||
|
)
|
||||||
|
|
||||||
const trackReference = {
|
const trackReference = useMemo(
|
||||||
participant,
|
() => cameraTrack ?? { participant, source: Source.Camera },
|
||||||
publication: participant.getTrackPublication(Source.Camera),
|
[cameraTrack, participant]
|
||||||
source: Source.Camera,
|
)
|
||||||
}
|
|
||||||
|
if (!participant) return
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledToastContainer {...toastProps} ref={ref}>
|
<StyledToastContainer {...toastProps} ref={ref}>
|
||||||
|
|||||||
Reference in New Issue
Block a user