diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx
index c8ddf96e..36f37036 100644
--- a/src/room/GroupCallView.tsx
+++ b/src/room/GroupCallView.tsx
@@ -132,18 +132,17 @@ export function GroupCallView({
const history = useHistory();
const onLeave = useCallback(() => {
+ setLeft(true);
leave();
if (widget) {
widget.api.transport.send(ElementWidgetActions.HangupCall, {});
widget.api.setAlwaysOnScreen(false);
}
- if (isPasswordlessUser) {
- setLeft(true);
- } else if (!isEmbedded) {
+ if (!isEmbedded) {
history.push("/");
}
- }, [leave, isPasswordlessUser, isEmbedded, history]);
+ }, [leave, isEmbedded, history]);
useEffect(() => {
if (widget && state === GroupCallState.Entered) {
@@ -208,7 +207,14 @@ export function GroupCallView({
);
} else if (left) {
- return ;
+ if (isPasswordlessUser) {
+ return ;
+ } else {
+ // If the user is a regular user, we'll have sent them back to the homepage,
+ // so just sit here & do nothing: otherwise we would (briefly) mount the
+ // LobbyView again which would open capture devices again.
+ return null;
+ }
} else if (preload) {
return null;
} else if (isEmbedded) {