mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-18 18:59:23 +00:00
Return to lobby after call ended in widget mode
Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -137,9 +137,6 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
}, [perParticipantE2EE, e2eeSharedKey]);
|
}, [perParticipantE2EE, e2eeSharedKey]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// this effect is only if we don't want to show the lobby (skipLobby = true)
|
|
||||||
if (!skipLobby) return;
|
|
||||||
|
|
||||||
const defaultDeviceSetup = async (
|
const defaultDeviceSetup = async (
|
||||||
requestedDeviceData: JoinCallData,
|
requestedDeviceData: JoinCallData,
|
||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
@@ -189,8 +186,9 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (widget && preload) {
|
|
||||||
// In preload mode, wait for a join action before entering
|
if (widget && preload && skipLobby) {
|
||||||
|
// In preload mode without lobby we wait for a join action before entering
|
||||||
const onJoin = async (
|
const onJoin = async (
|
||||||
ev: CustomEvent<IWidgetApiRequest>,
|
ev: CustomEvent<IWidgetApiRequest>,
|
||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
@@ -205,10 +203,15 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
return () => {
|
return () => {
|
||||||
widget!.lazyActions.off(ElementWidgetActions.JoinCall, onJoin);
|
widget!.lazyActions.off(ElementWidgetActions.JoinCall, onJoin);
|
||||||
};
|
};
|
||||||
} else {
|
} else if (widget && !preload && skipLobby) {
|
||||||
// if we don't use preload and only skipLobby we enter the rtc session right away
|
// No lobby and no preload: we enter the rtc session right away
|
||||||
|
widget.api.setAlwaysOnScreen(true);
|
||||||
defaultDeviceSetup({ audioInput: null, videoInput: null });
|
defaultDeviceSetup({ audioInput: null, videoInput: null });
|
||||||
enterRTCSession(rtcSession, perParticipantE2EE);
|
enterRTCSession(rtcSession, perParticipantE2EE);
|
||||||
|
} else if (widget && !skipLobby) {
|
||||||
|
// If we show the lobby, we still need to set the widget to sticky
|
||||||
|
// joining will be triggered by the lobby view.
|
||||||
|
widget!.api.setAlwaysOnScreen(true);
|
||||||
}
|
}
|
||||||
}, [rtcSession, preload, skipLobby, perParticipantE2EE]);
|
}, [rtcSession, preload, skipLobby, perParticipantE2EE]);
|
||||||
|
|
||||||
@@ -338,7 +341,7 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
} else if (left) {
|
} else if (left && widget === null) {
|
||||||
// The call ended view is shown for two reasons: prompting guests to create
|
// The call ended view is shown for two reasons: prompting guests to create
|
||||||
// an account, and prompting users that have opted into analytics to provide
|
// an account, and prompting users that have opted into analytics to provide
|
||||||
// feedback. We don't show a feedback prompt to widget users however (at
|
// feedback. We don't show a feedback prompt to widget users however (at
|
||||||
@@ -366,7 +369,7 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
// LobbyView again which would open capture devices again.
|
// LobbyView again which would open capture devices again.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else if (preload) {
|
} else if (preload || skipLobby) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user