From 599a4708cb0bbad27052e9eaa193d7d52f6e3f2d Mon Sep 17 00:00:00 2001 From: Timo <16718859+toger5@users.noreply.github.com> Date: Wed, 31 Jul 2024 13:21:37 +0200 Subject: [PATCH] Backport deviceSetup await (#2522) --- src/room/GroupCallView.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index a88d1126..6d1438b0 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -190,7 +190,7 @@ export const GroupCallView: FC = ({ const onJoin = async ( ev: CustomEvent, ): Promise => { - defaultDeviceSetup(ev.detail.data as unknown as JoinCallData); + await defaultDeviceSetup(ev.detail.data as unknown as JoinCallData); await enterRTCSession(rtcSession, perParticipantE2EE); await widget!.api.transport.reply(ev.detail, {}); }; @@ -199,9 +199,12 @@ export const GroupCallView: FC = ({ widget!.lazyActions.off(ElementWidgetActions.JoinCall, onJoin); }; } else if (widget && !preload && skipLobby) { - // No lobby and no preload: we enter the rtc session right away - defaultDeviceSetup({ audioInput: null, videoInput: null }); - enterRTCSession(rtcSession, perParticipantE2EE); + const join = async (): Promise => { + await defaultDeviceSetup({ audioInput: null, videoInput: null }); + await enterRTCSession(rtcSession, perParticipantE2EE); + }; + // No lobby and no preload: we enter the RTC Session right away. + join(); } }, [rtcSession, preload, skipLobby, perParticipantE2EE]);