Skip to content

Commit

Permalink
Fix bug where microphone error shows twice (#5668)
Browse files Browse the repository at this point in the history
* fix bug where mic error shows twice

* Change files

* update
  • Loading branch information
carocao-msft authored Feb 28, 2025
1 parent f84a726 commit 893b40f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "Fix bug where microphone error shows twice",
"comment": "Fix bug where microphone error shows twice",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "Fix bug where microphone error shows twice",
"comment": "Fix bug where microphone error shows twice",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
8 changes: 4 additions & 4 deletions packages/calling-component-bindings/src/errorBarSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ export const errorBarSelector: ErrorBarSelector = createSelector(
if (deviceManager.deviceAccess?.audio === false && isSafari()) {
activeErrorMessages.push({ type: 'callMicrophoneAccessDeniedSafari' });
}
if (deviceManager.deviceAccess?.audio === false && !isSafari()) {
activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });
}

if (diagnostics?.media.latest.microphonePermissionDenied?.value === true && isMacOS()) {
activeErrorMessages.push({ type: 'callMacOsMicrophoneAccessDenied' });
} else if (diagnostics?.media.latest.microphonePermissionDenied?.value === true) {
} else if (
(deviceManager.deviceAccess?.audio === false && !isSafari()) ||
(diagnostics?.media.latest.microphonePermissionDenied?.value === true && !isMacOS())
) {
activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ export const notificationStackSelector: NotificationStackSelector = createSelect
if (deviceManager.deviceAccess?.audio === false && isSafari()) {
activeErrorMessages.push({ type: 'callMicrophoneAccessDeniedSafari' });
}
if (deviceManager.deviceAccess?.audio === false && !isSafari()) {
activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });
}

if (diagnostics?.media.latest.microphonePermissionDenied?.value === true && isMacOS()) {
activeErrorMessages.push({ type: 'callMacOsMicrophoneAccessDenied' });
} else if (diagnostics?.media.latest.microphonePermissionDenied?.value === true) {
} else if (
(deviceManager.deviceAccess?.audio === false && !isSafari()) ||
(diagnostics?.media.latest.microphonePermissionDenied?.value === true && !isMacOS())
) {
activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });
}

Expand Down

0 comments on commit 893b40f

Please sign in to comment.