fix: joinCall set correct mute state based on microphoneOn parameter#2131
fix: joinCall set correct mute state based on microphoneOn parameter#2131JamesBurnside merged 9 commits intoAzure:mainfrom
Conversation
prprabhu-ms
left a comment
There was a problem hiding this comment.
Thank you for your contribution!
I checked in the rest of the codebase and turns out we don't ever call joinCall with microphoneOn set (to either true or false). That is why things were not on fire already.
Thanks for catching this.
|
|
||
| return this.teeErrorToEventEmitter(() => { | ||
| const audioOptions: AudioOptions = { muted: microphoneOn ?? !this.getState().isLocalPreviewMicrophoneEnabled }; | ||
| const audioOptions: AudioOptions = { muted: !microphoneOn ?? !this.getState().isLocalPreviewMicrophoneEnabled }; |
There was a problem hiding this comment.
microphoneOn is optional. If we check for falsiness, calling joinCall() without any arguments will cause muted to be set to true.
So, fallback on undefined, and then check for falsiness...
| const audioOptions: AudioOptions = { muted: !microphoneOn ?? !this.getState().isLocalPreviewMicrophoneEnabled }; | |
| const audioOptions: AudioOptions = { muted: !(microphoneOn ?? this.getState().isLocalPreviewMicrophoneEnabled) }; |
There was a problem hiding this comment.
Great suggestion. I've fixed my code.
|
Do you mind running The type should be "patch" (as this is a bugfix). The PR title is a good change description. |
|
I'm trying to figure out why chromatic is unhappy. |
…tion-ui-library into joinCall-microphoneOn-fix
|
Done. |
What
Fixed a bug where the initial muted state is not being set correctly.
Why
When
microphoneOnis true,mutedwill be true which is backward of what the code is intended to do.How Tested
I tested calling
joinCallwithmicrophoneOnparametertrueand the call will start muted which is incorrect.Process & policy checklist
Is this a breaking change?