Skip to content

Commit 3dad62f

Browse files
toger5robintown
andauthored
Skip lobby when coming from waitForInvite state. (#2753)
* Skip lobby if when coming from waitForInvite state. * knock reject wording update (shorter/simpler) * Automatically enter session also in non widget mode when skipLobby = true * Update public/locales/en-GB/app.json Co-authored-by: Robin <[email protected]> * review * review andrew --------- Co-authored-by: Robin <[email protected]>
1 parent 8465bb4 commit 3dad62f

File tree

6 files changed

+141
-186
lines changed

6 files changed

+141
-186
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ rc_message:
106106

107107
MSC3266 allows to request a room summary of rooms you are not joined. The
108108
summary contains the room join rules. We need that to decide if the user gets
109-
prompted with the option to knock ("ask to join"), a cannot join error or the
109+
prompted with the option to knock ("Request to join call"), a cannot join error or the
110110
join view.
111111

112112
Element Call requires a Livekit SFU alongside a [Livekit JWT

public/locales/en-GB/app.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
"call_ended_heading": "Call ended",
8282
"failed_heading": "Failed to join",
8383
"failed_text": "Call not found or is not accessible.",
84-
"knock_reject_body": "The room members declined your request to join.",
85-
"knock_reject_heading": "Not allowed to join",
84+
"knock_reject_body": "Your request to join was declined.",
85+
"knock_reject_heading": "Access denied",
8686
"reason": "Reason"
8787
},
8888
"hangup_button_label": "End call",
@@ -100,11 +100,11 @@
100100
"layout_grid_label": "Grid",
101101
"layout_spotlight_label": "Spotlight",
102102
"lobby": {
103-
"ask_to_join": "Ask to join call",
103+
"ask_to_join": "Request to join call",
104104
"join_as_guest": "Join as guest",
105105
"join_button": "Join call",
106106
"leave_button": "Back to recents",
107-
"waiting_for_invite": "Request sent"
107+
"waiting_for_invite": "Request sent! Waiting for permission to join…"
108108
},
109109
"log_in": "Log In",
110110
"logging_in": "Logging in…",

src/room/GroupCallLoader.tsx

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/room/GroupCallView.tsx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -177,29 +177,33 @@ export const GroupCallView: FC<Props> = ({
177177
}
178178
};
179179

180-
if (widget && preload && skipLobby) {
181-
// In preload mode without lobby we wait for a join action before entering
182-
const onJoin = (ev: CustomEvent<IWidgetApiRequest>): void => {
180+
if (skipLobby) {
181+
if (widget && preload) {
182+
// In preload mode without lobby we wait for a join action before entering
183+
const onJoin = (ev: CustomEvent<IWidgetApiRequest>): void => {
184+
(async (): Promise<void> => {
185+
await defaultDeviceSetup(ev.detail.data as unknown as JoinCallData);
186+
await enterRTCSession(rtcSession, perParticipantE2EE);
187+
widget!.api.transport.reply(ev.detail, {});
188+
})().catch((e) => {
189+
logger.error("Error joining RTC session", e);
190+
});
191+
};
192+
widget.lazyActions.on(ElementWidgetActions.JoinCall, onJoin);
193+
return (): void => {
194+
widget!.lazyActions.off(ElementWidgetActions.JoinCall, onJoin);
195+
};
196+
} else if (widget && !preload) {
197+
// No lobby and no preload: we enter the rtc session right away
183198
(async (): Promise<void> => {
184-
await defaultDeviceSetup(ev.detail.data as unknown as JoinCallData);
199+
await defaultDeviceSetup({ audioInput: null, videoInput: null });
185200
await enterRTCSession(rtcSession, perParticipantE2EE);
186-
widget!.api.transport.reply(ev.detail, {});
187201
})().catch((e) => {
188202
logger.error("Error joining RTC session", e);
189203
});
190-
};
191-
widget.lazyActions.on(ElementWidgetActions.JoinCall, onJoin);
192-
return (): void => {
193-
widget!.lazyActions.off(ElementWidgetActions.JoinCall, onJoin);
194-
};
195-
} else if (widget && !preload && skipLobby) {
196-
// No lobby and no preload: we enter the rtc session right away
197-
(async (): Promise<void> => {
198-
await defaultDeviceSetup({ audioInput: null, videoInput: null });
199-
await enterRTCSession(rtcSession, perParticipantE2EE);
200-
})().catch((e) => {
201-
logger.error("Error joining RTC session", e);
202-
});
204+
} else {
205+
void enterRTCSession(rtcSession, perParticipantE2EE);
206+
}
203207
}
204208
}, [rtcSession, preload, skipLobby, perParticipantE2EE]);
205209

0 commit comments

Comments
 (0)