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:
Xin Wang
2026-07-10 17:06:57 +08:00
parent 8c0358ad91
commit bb71d28721

View File

@@ -300,7 +300,10 @@ export function MobileCallPage({ assistantId }: { assistantId: string }) {
}, [startCall]);
useEffect(() => {
if (status === "idle" || status === "failed") stopCamera();
if (status === "idle" || status === "failed") {
stopCamera();
setView("camera");
}
}, [status, stopCamera]);
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" />
{view === "chat" && <MobileCallTranscript messages={messages} />}
{view === "chat" && inCall && <MobileCallTranscript messages={messages} />}
<NetworkQualityIndicator
quality={networkQuality}