From d2b15368507e9820150812a527bf756c5fe1372d Mon Sep 17 00:00:00 2001 From: fkwp Date: Wed, 23 Sep 2026 20:08:54 +0200 Subject: [PATCH] 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) --- src/components/MediaMuteAndSwitchButton.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/MediaMuteAndSwitchButton.tsx b/src/components/MediaMuteAndSwitchButton.tsx index bdbaf3a80..a39c5ea43 100644 --- a/src/components/MediaMuteAndSwitchButton.tsx +++ b/src/components/MediaMuteAndSwitchButton.tsx @@ -298,15 +298,15 @@ export const MediaMuteAndSwitchButton: FC = ({ // 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 // 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 = plannedSelection !== null && - plannedSelection.id !== - (plannedSelection.kind === "output" - ? selectedOutputOption - : selectedOption) && - (plannedSelection.kind === "output" ? outputOptions : options)?.some( - ({ id }) => id === plannedSelection.id, - ) === true; + plannedSelection.id !== selectedOfPlannedKind && + offeredOfPlannedKind?.some(({ id }) => id === plannedSelection.id) === true; // 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