Skip to content

Commit 4f8fbac

Browse files
committed
fmt
1 parent 19916dd commit 4f8fbac

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

packages/react/src/hooks/useVoiceAssistant.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,20 @@ export function useVoiceAssistant(): VoiceAssistant {
5151
(p) =>
5252
p.kind === ParticipantKind.AGENT && p.attributes['lk.publish_on_behalf'] === agent?.identity,
5353
);
54-
const agentTracks = useParticipantTracks([Track.Source.Microphone, Track.Source.Camera], agent?.identity);
55-
const workerTracks = useParticipantTracks([Track.Source.Microphone, Track.Source.Camera], worker?.identity);
56-
const audioTrack = agentTracks.find((t) => t.source === Track.Source.Microphone) ?? workerTracks.find((t) => t.source === Track.Source.Microphone);
57-
const videoTrack = agentTracks.find((t) => t.source === Track.Source.Camera) ?? workerTracks.find((t) => t.source === Track.Source.Camera);
54+
const agentTracks = useParticipantTracks(
55+
[Track.Source.Microphone, Track.Source.Camera],
56+
agent?.identity,
57+
);
58+
const workerTracks = useParticipantTracks(
59+
[Track.Source.Microphone, Track.Source.Camera],
60+
worker?.identity,
61+
);
62+
const audioTrack =
63+
agentTracks.find((t) => t.source === Track.Source.Microphone) ??
64+
workerTracks.find((t) => t.source === Track.Source.Microphone);
65+
const videoTrack =
66+
agentTracks.find((t) => t.source === Track.Source.Camera) ??
67+
workerTracks.find((t) => t.source === Track.Source.Camera);
5868
const { segments: agentTranscriptions } = useTrackTranscription(audioTrack);
5969
const connectionState = useConnectionState();
6070
const { attributes } = useParticipantAttributes({ participant: agent });

0 commit comments

Comments
 (0)