Enhance MobileCallPage functionality with camera view reset and chat transcript condition
- Update the effect to reset the view to "camera" when the call status is "idle" or "failed", improving user experience during call interruptions. - Modify the rendering condition for the MobileCallTranscript to only display when inCall is true, ensuring chat messages are shown appropriately during active calls.
This commit is contained in:
@@ -300,7 +300,10 @@ export function MobileCallPage({ assistantId }: { assistantId: string }) {
|
|||||||
}, [startCall]);
|
}, [startCall]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (status === "idle" || status === "failed") stopCamera();
|
if (status === "idle" || status === "failed") {
|
||||||
|
stopCamera();
|
||||||
|
setView("camera");
|
||||||
|
}
|
||||||
}, [status, stopCamera]);
|
}, [status, stopCamera]);
|
||||||
|
|
||||||
const error = previewError || cameraError;
|
const error = previewError || cameraError;
|
||||||
@@ -325,7 +328,7 @@ export function MobileCallPage({ assistantId }: { assistantId: string }) {
|
|||||||
|
|
||||||
<div className="pointer-events-none absolute inset-0 bg-gradient-to-b from-black/35 via-transparent to-black/65" />
|
<div className="pointer-events-none absolute inset-0 bg-gradient-to-b from-black/35 via-transparent to-black/65" />
|
||||||
|
|
||||||
{view === "chat" && <MobileCallTranscript messages={messages} />}
|
{view === "chat" && inCall && <MobileCallTranscript messages={messages} />}
|
||||||
|
|
||||||
<NetworkQualityIndicator
|
<NetworkQualityIndicator
|
||||||
quality={networkQuality}
|
quality={networkQuality}
|
||||||
|
|||||||
Reference in New Issue
Block a user