cleanup
This commit is contained in:
@@ -314,6 +314,7 @@ export const GroupCallView: FC<Props> = ({
|
|||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
// TODO split this into leave and onDisconnect
|
||||||
const onLeft = useCallback(
|
const onLeft = useCallback(
|
||||||
(
|
(
|
||||||
reason: "timeout" | "user" | "allOthersLeft" | "decline" | "error",
|
reason: "timeout" | "user" | "allOthersLeft" | "decline" | "error",
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
|
|||||||
setVm(vm);
|
setVm(vm);
|
||||||
|
|
||||||
vm.leave$.pipe(scope.bind()).subscribe(props.onLeft);
|
vm.leave$.pipe(scope.bind()).subscribe(props.onLeft);
|
||||||
|
|
||||||
return (): void => {
|
return (): void => {
|
||||||
scope.end();
|
scope.end();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -221,30 +221,6 @@ export const createLocalMembership$ = ({
|
|||||||
switchMap((connection) => (connection ? connection.state$ : of(null))),
|
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
|
// MATRIX RELATED
|
||||||
|
|
||||||
const reconnecting$ = scope.behavior(
|
const reconnecting$ = scope.behavior(
|
||||||
@@ -365,7 +341,6 @@ export const createLocalMembership$ = ({
|
|||||||
map(() => true),
|
map(() => true),
|
||||||
startWith(false),
|
startWith(false),
|
||||||
),
|
),
|
||||||
// TODO use local connection state here to give the full pciture of the livekit state!
|
|
||||||
fatalLivekitError$,
|
fatalLivekitError$,
|
||||||
]).pipe(
|
]).pipe(
|
||||||
map(
|
map(
|
||||||
|
|||||||
Reference in New Issue
Block a user