Skip to content

Commit 893b40f

Browse files
authored
Fix bug where microphone error shows twice (#5668)
* fix bug where mic error shows twice * Change files * update
1 parent f84a726 commit 893b40f

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Fix bug where microphone error shows twice",
5+
"comment": "Fix bug where microphone error shows twice",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Fix bug where microphone error shows twice",
5+
"comment": "Fix bug where microphone error shows twice",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}

packages/calling-component-bindings/src/errorBarSelector.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ export const errorBarSelector: ErrorBarSelector = createSelector(
7676
if (deviceManager.deviceAccess?.audio === false && isSafari()) {
7777
activeErrorMessages.push({ type: 'callMicrophoneAccessDeniedSafari' });
7878
}
79-
if (deviceManager.deviceAccess?.audio === false && !isSafari()) {
80-
activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });
81-
}
8279

8380
if (diagnostics?.media.latest.microphonePermissionDenied?.value === true && isMacOS()) {
8481
activeErrorMessages.push({ type: 'callMacOsMicrophoneAccessDenied' });
85-
} else if (diagnostics?.media.latest.microphonePermissionDenied?.value === true) {
82+
} else if (
83+
(deviceManager.deviceAccess?.audio === false && !isSafari()) ||
84+
(diagnostics?.media.latest.microphonePermissionDenied?.value === true && !isMacOS())
85+
) {
8686
activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });
8787
}
8888

packages/calling-component-bindings/src/notificationStackSelector.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ export const notificationStackSelector: NotificationStackSelector = createSelect
109109
if (deviceManager.deviceAccess?.audio === false && isSafari()) {
110110
activeErrorMessages.push({ type: 'callMicrophoneAccessDeniedSafari' });
111111
}
112-
if (deviceManager.deviceAccess?.audio === false && !isSafari()) {
113-
activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });
114-
}
115112

116113
if (diagnostics?.media.latest.microphonePermissionDenied?.value === true && isMacOS()) {
117114
activeErrorMessages.push({ type: 'callMacOsMicrophoneAccessDenied' });
118-
} else if (diagnostics?.media.latest.microphonePermissionDenied?.value === true) {
115+
} else if (
116+
(deviceManager.deviceAccess?.audio === false && !isSafari()) ||
117+
(diagnostics?.media.latest.microphonePermissionDenied?.value === true && !isMacOS())
118+
) {
119119
activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });
120120
}
121121

0 commit comments

Comments
 (0)