Merge pull request #602 from vector-im/dbkr/fix_capture_devices_left_on
Fix bug causing mic/webcam to remain open after call
This commit is contained in:
commit
b55aa12100
1 changed files with 10 additions and 4 deletions
|
@ -132,15 +132,14 @@ export function GroupCallView({
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
const onLeave = useCallback(() => {
|
const onLeave = useCallback(() => {
|
||||||
|
setLeft(true);
|
||||||
leave();
|
leave();
|
||||||
if (widget) {
|
if (widget) {
|
||||||
widget.api.transport.send(ElementWidgetActions.HangupCall, {});
|
widget.api.transport.send(ElementWidgetActions.HangupCall, {});
|
||||||
widget.api.setAlwaysOnScreen(false);
|
widget.api.setAlwaysOnScreen(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPasswordlessUser) {
|
if (!isPasswordlessUser && !isEmbedded) {
|
||||||
setLeft(true);
|
|
||||||
} else if (!isEmbedded) {
|
|
||||||
history.push("/");
|
history.push("/");
|
||||||
}
|
}
|
||||||
}, [leave, isPasswordlessUser, isEmbedded, history]);
|
}, [leave, isPasswordlessUser, isEmbedded, history]);
|
||||||
|
@ -208,7 +207,14 @@ export function GroupCallView({
|
||||||
</FullScreenView>
|
</FullScreenView>
|
||||||
);
|
);
|
||||||
} else if (left) {
|
} else if (left) {
|
||||||
return <CallEndedView client={client} />;
|
if (isPasswordlessUser) {
|
||||||
|
return <CallEndedView client={client} />;
|
||||||
|
} 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) {
|
} else if (preload) {
|
||||||
return null;
|
return null;
|
||||||
} else if (isEmbedded) {
|
} else if (isEmbedded) {
|
||||||
|
|
Loading…
Reference in a new issue