fix whoopsie

This commit is contained in:
Half-Shot
2025-09-16 14:10:27 +01:00
parent 82392bf582
commit 30a130ac70

View File

@@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details.
import { RoomContext, useLocalParticipant } from "@livekit/components-react"; import { RoomContext, useLocalParticipant } from "@livekit/components-react";
import { IconButton, Text, Tooltip } from "@vector-im/compound-web"; import { IconButton, Text, Tooltip } from "@vector-im/compound-web";
import { type Room as LivekitRoom } from "livekit-client"; import { ConnectionState, type Room as LivekitRoom } from "livekit-client";
import { type MatrixClient, type Room as MatrixRoom } from "matrix-js-sdk"; import { type MatrixClient, type Room as MatrixRoom } from "matrix-js-sdk";
import { import {
type FC, type FC,
@@ -253,11 +253,12 @@ export const InCallView: FC<InCallViewProps> = ({
useReactionsSender(); useReactionsSender();
useWakeLock(); useWakeLock();
const isDisconnected = useObservableEagerState(vm.livekitConnectionState$); const connectionState = useObservableEagerState(vm.livekitConnectionState$);
// annoyingly we don't get the disconnection reason this way, // annoyingly we don't get the disconnection reason this way,
// only by listening for the emitted event // only by listening for the emitted event
if (isDisconnected) throw new ConnectionLostError(); if (connectionState === ConnectionState.Disconnected)
throw new ConnectionLostError();
const containerRef1 = useRef<HTMLDivElement | null>(null); const containerRef1 = useRef<HTMLDivElement | null>(null);
const [containerRef2, bounds] = useMeasure(); const [containerRef2, bounds] = useMeasure();