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:
David Baker 2022-09-23 17:09:39 +01:00 committed by GitHub
commit b55aa12100
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,15 +132,14 @@ 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 (!isPasswordlessUser && !isEmbedded) {
history.push("/");
}
}, [leave, isPasswordlessUser, isEmbedded, history]);
@ -208,7 +207,14 @@ export function GroupCallView({
</FullScreenView>
);
} else if (left) {
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) {
return null;
} else if (isEmbedded) {