From 8691473329b75bd3fdcd75bc47ad2a006c4fb04d Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Mon, 6 Oct 2025 16:02:44 +0100 Subject: [PATCH] Disable call button while the call is connecting. --- src/room/GroupCallView.tsx | 2 +- src/room/LobbyView.tsx | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index e4a6a997..89ddb910 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -436,7 +436,7 @@ export const GroupCallView: FC = ({ client={client} matrixInfo={matrixInfo} muteStates={muteStates} - onEnter={() => void enterRTCSessionOrError(rtcSession)} + onEnter={() => enterRTCSessionOrError(rtcSession)} confineToRoom={confineToRoom} hideHeader={header === HeaderStyle.None} participantCount={participantCount} diff --git a/src/room/LobbyView.tsx b/src/room/LobbyView.tsx index 391cb391..70925a9c 100644 --- a/src/room/LobbyView.tsx +++ b/src/room/LobbyView.tsx @@ -57,7 +57,7 @@ interface Props { client: MatrixClient; matrixInfo: MatrixInfo; muteStates: MuteStates; - onEnter: () => void; + onEnter: () => Promise; enterLabel?: JSX.Element | string; confineToRoom: boolean; hideHeader: boolean; @@ -193,6 +193,17 @@ export const LobbyView: FC = ({ useTrackProcessorSync(videoTrack); + const onEnterCall = useCallback(async () => { + try { + setWaiting(true); + await onEnter(); + } finally { + setWaiting(false); + } + }, [onEnter]); + + const [waiting, setWaiting] = useState(waitingForInvite); + // TODO: Unify this component with InCallView, so we can get slick joining // animations and don't have to feel bad about reusing its CSS return ( @@ -222,11 +233,12 @@ export const LobbyView: FC = ({ >