Name what the settling check compares against

- Pull the planned kind's selection and its offered devices into named values.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
fkwp
2026-09-23 20:08:54 +02:00
co-authored by Claude Opus 5.5
parent 870556d66f
commit d2b1536850
+7 -7
View File
@@ -298,15 +298,15 @@ export const MediaMuteAndSwitchButton: FC<MediaMuteAndSwitchButtonProps> = ({
// that is removed before it takes effect never arrives — the selection falls // that is removed before it takes effect never arrives — the selection falls
// back to the default instead — and waiting for it would leave every device // back to the default instead — and waiting for it would leave every device
// in both sections unselectable for the rest of the call. // in both sections unselectable for the rest of the call.
const plannedOutput = plannedSelection?.kind === "output";
const selectedOfPlannedKind = plannedOutput
? selectedOutputOption
: selectedOption;
const offeredOfPlannedKind = plannedOutput ? outputOptions : options;
const settling = const settling =
plannedSelection !== null && plannedSelection !== null &&
plannedSelection.id !== plannedSelection.id !== selectedOfPlannedKind &&
(plannedSelection.kind === "output" offeredOfPlannedKind?.some(({ id }) => id === plannedSelection.id) === true;
? selectedOutputOption
: selectedOption) &&
(plannedSelection.kind === "output" ? outputOptions : options)?.some(
({ id }) => id === plannedSelection.id,
) === true;
// Safari enumerates no output devices at all, and offers no way to choose // Safari enumerates no output devices at all, and offers no way to choose
// one, so the list arrives empty. The section is shown all the same — audio // one, so the list arrives empty. The section is shown all the same — audio