mirror of
https://github.com/vector-im/element-call.git
synced 2026-09-25 22:35:49 +00:00
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user