diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 43602716..dfd11ff3 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -314,6 +314,7 @@ export const GroupCallView: FC = ({ const navigate = useNavigate(); + // TODO split this into leave and onDisconnect const onLeft = useCallback( ( reason: "timeout" | "user" | "allOthersLeft" | "decline" | "error", diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 6ae004d8..7ae3700c 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -151,6 +151,7 @@ export const ActiveCall: FC = (props) => { setVm(vm); vm.leave$.pipe(scope.bind()).subscribe(props.onLeft); + return (): void => { scope.end(); }; diff --git a/src/state/CallViewModel/localMember/LocalMembership.ts b/src/state/CallViewModel/localMember/LocalMembership.ts index 33af5192..6a31ce4b 100644 --- a/src/state/CallViewModel/localMember/LocalMembership.ts +++ b/src/state/CallViewModel/localMember/LocalMembership.ts @@ -221,30 +221,6 @@ export const createLocalMembership$ = ({ switchMap((connection) => (connection ? connection.state$ : of(null))), ); - // /** - // * Whether we are "fully" connected to the call. Accounts for both the - // * connection to the MatrixRTC session and the LiveKit publish connection. - // */ - // TODO remove this and just make it one single check of livekitConnectionState$ - // const connected$ = scope.behavior( - // localConnectionState$.pipe( - // switchMap((state) => { - // logger.debug("livekit: Connected state changed", state); - // if (!state) return of(false); - // if (state.state === "ConnectedToLkRoom") { - // logger.debug( - // "livekit: Connected state changed (inner livekitConnectionState$)", - // state.livekitConnectionState$.value, - // ); - // return state.livekitConnectionState$.pipe( - // map((lkState) => lkState === ConnectionState.Connected), - // ); - // } - // return of(false); - // }), - // ), - // ); - // MATRIX RELATED const reconnecting$ = scope.behavior( @@ -365,7 +341,6 @@ export const createLocalMembership$ = ({ map(() => true), startWith(false), ), - // TODO use local connection state here to give the full pciture of the livekit state! fatalLivekitError$, ]).pipe( map(