Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/room/GroupCallView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export const GroupCallView: FC<Props> = ({
client={client}
matrixInfo={matrixInfo}
muteStates={muteStates}
onEnter={() => void enterRTCSessionOrError(rtcSession)}
onEnter={async () => enterRTCSessionOrError(rtcSession)}
confineToRoom={confineToRoom}
hideHeader={header === HeaderStyle.None}
participantCount={participantCount}
Expand Down
17 changes: 13 additions & 4 deletions src/room/LobbyView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ interface Props {
client: MatrixClient;
matrixInfo: MatrixInfo;
muteStates: MuteStates;
onEnter: () => void;
onEnter: () => Promise<void>;
enterLabel?: JSX.Element | string;
confineToRoom: boolean;
hideHeader: boolean;
Expand Down Expand Up @@ -193,6 +193,14 @@ export const LobbyView: FC<Props> = ({

useTrackProcessorSync(videoTrack);

const [waitingToEnter, setWaitingToEnter] = useState(false);
const onEnterCall = useCallback(() => {
setWaitingToEnter(true);
void onEnter().finally(() => setWaitingToEnter(false));
}, [onEnter]);

const waiting = waitingForInvite || waitingToEnter;

// 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 (
Expand Down Expand Up @@ -222,11 +230,12 @@ export const LobbyView: FC<Props> = ({
>
<Button
className={classNames(styles.join, {
[styles.wait]: waitingForInvite,
[styles.wait]: waiting,
})}
size={waitingForInvite ? "sm" : "lg"}
size={waiting ? "sm" : "lg"}
disabled={waiting}
onClick={() => {
if (!waitingForInvite) onEnter();
if (!waiting) onEnterCall();
}}
data-testid="lobby_joinCall"
>
Expand Down
2 changes: 1 addition & 1 deletion src/room/RoomPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
: E2eeType.NONE,
},
}}
onEnter={(): void => knock?.()}
onEnter={async (): Promise<void> => knock?.()}

Check failure on line 154 in src/room/RoomPage.tsx

View workflow job for this annotation

GitHub Actions / Lint, format & type check

Async arrow function has no 'await' expression
enterLabel={label}
waitingForInvite={groupCallState.kind === "waitForInvite"}
confineToRoom={confineToRoom}
Expand Down
Loading