Skip to content

Commit dac0173

Browse files
fix(call): clear recovery ref on early-return paths and add DailyVideo width
Address PR review feedback: - Clear loggedUnavailableRef and show recovery banner when the device is already matched (early-return path), not just when we actively switch. Prevents stale ref from suppressing future fallback logging. - Add explicit w-full h-auto to DailyVideo self-view to ensure proper sizing alongside object-contain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bcffa86 commit dac0173

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

client/src/call/FixAV.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ export function useFixAV(
704704
<DailyVideo
705705
sessionId={localSessionId}
706706
mirror
707-
className="max-h-40 rounded-lg object-contain"
707+
className="h-auto max-h-40 w-full rounded-lg object-contain"
708708
/>
709709
</div>
710710
</div>

client/src/call/hooks/useDeviceAlignment.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,18 @@ export function useDeviceAlignment(
199199
if (currentDeviceId === targetId) {
200200
// Clear any stale banner if the device is now matched
201201
if (clearBannersForDevice) clearBannersForDevice(deviceType);
202+
// If we previously fell back, clear the ref and show recovery banner
203+
if (loggedUnavailableRef.current === preferredId) {
204+
// eslint-disable-next-line no-param-reassign
205+
loggedUnavailableRef.current = null;
206+
if (addDeviceBanner) {
207+
const deviceName = targetDevice.device.label || preferredLabel || preferredId;
208+
addDeviceBanner({
209+
deviceType,
210+
message: `"${deviceName}" reconnected — switched back`,
211+
});
212+
}
213+
}
202214
return;
203215
}
204216

@@ -340,6 +352,17 @@ export function useDeviceAlignment(
340352

341353
if (devices?.currentSpeaker?.device?.deviceId === targetId) {
342354
if (clearBannersForDevice) clearBannersForDevice("speaker");
355+
// If we previously fell back, clear the ref and show recovery banner
356+
if (loggedUnavailableSpeakerRef.current === preferredSpeakerId) {
357+
loggedUnavailableSpeakerRef.current = null;
358+
if (addDeviceBanner) {
359+
const deviceName = targetSpeaker.device.label || preferredSpeakerLabel || preferredSpeakerId;
360+
addDeviceBanner({
361+
deviceType: "speaker",
362+
message: `"${deviceName}" reconnected — switched back`,
363+
});
364+
}
365+
}
343366
return;
344367
}
345368

0 commit comments

Comments
 (0)