Keep screenshares when switching focus

This also removes the use of the useLivekitRoom hook: we had reached
the point where the only thing it was actually doing was disconnecting,
so we now do that in the onClick handler for the leave button (I don't
think we need to disconnect on unmount?). It was otherwise just getting in
the way and causing tracks to be enabled/disabled when we didn't want them
to be. This also removes the need for the blockAudio code.

Fixes https://github.com/vector-im/element-call/issues/1413
This commit is contained in:
David Baker
2023-11-10 15:24:43 +00:00
parent 5ab6d18712
commit c146e83c15
3 changed files with 82 additions and 42 deletions

View File

@@ -200,8 +200,9 @@ export const InCallView: FC<InCallViewProps> = ({
);
const onLeavePress = useCallback(() => {
livekitRoom.disconnect();
onLeave();
}, [onLeave]);
}, [livekitRoom, onLeave]);
useEffect(() => {
widget?.api.transport.send(