diff --git a/src/app/features/call/CallView.tsx b/src/app/features/call/CallView.tsx index f4e21a5ab..5973d9bf6 100644 --- a/src/app/features/call/CallView.tsx +++ b/src/app/features/call/CallView.tsx @@ -6,12 +6,13 @@ import { useCallJoined, useCallEmbedPlacementSync, useCallLoadError, + useCallStart, } from '../../hooks/useCallEmbed'; import { callEmbedAtom } from '../../state/callEmbed'; import { ContainerColor } from '../../styles/ContainerColor.css'; import { PrescreenControls } from './PrescreenControls'; import { usePowerLevelsContext } from '../../hooks/usePowerLevels'; -import { useRoom } from '../../hooks/useRoom'; +import { useIsDirectRoom, useRoom } from '../../hooks/useRoom'; import { useRoomCreators } from '../../hooks/useRoomCreators'; import { useRoomPermissions } from '../../hooks/useRoomPermissions'; import { useMatrixClient } from '../../hooks/useMatrixClient'; @@ -160,6 +161,16 @@ function CallLoadErrorMessage() { // prescreen, where they can choose to join again. const dismiss = () => setCallEmbed(undefined); + // [Gitea #301] Try again: start a fresh embed for the same room with the + // same mic/camera/sound choices (starting one disposes the hung one). + const callEmbed = useCallEmbed(); + const startCall = useCallStart(useIsDirectRoom()); + const retry = () => { + if (!callEmbed) return; + const { room, control } = callEmbed; + startCall(room, { microphone: control.microphone, video: control.video, sound: control.sound }); + }; + return ( +