Skip to content

Commit 8d8b8ee

Browse files
authored
Merge pull request #273 from Azure-Samples/chwhilar/show-all-ufds-for-testing-purposes
show all ufds and messages for testing purposes
2 parents 8d280b8 + 85adb50 commit 8d8b8ee

File tree

3 files changed

+89
-22
lines changed

3 files changed

+89
-22
lines changed

Project/package-lock.json

Lines changed: 81 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Project/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"private": true,
55
"dependencies": {
6-
"@azure/communication-calling": "1.35.1-beta.1",
6+
"@azure/communication-calling": "1.37.1-beta.1",
77
"@azure/communication-calling-effects": "1.1.1-beta.1",
88
"@azure/communication-common": "^2.3.0",
99
"@azure/communication-identity": "^1.3.0",

Project/src/MakeCall/MakeCall.js

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default class MakeCall extends React.Component {
8888

8989
setInterval(() => {
9090
if (this.state.ufdMessages.length > 0) {
91-
this.setState({ ufdMessages: this.state.ufdMessages.slice(1) });
91+
this.setState({ ufdMessages: this.state.ufdMessages.slice() });
9292
}
9393
}, 10000);
9494

@@ -173,16 +173,9 @@ export default class MakeCall extends React.Component {
173173
Diagnostic: ${diagnosticInfo.diagnostic}
174174
Value: ${diagnosticInfo.value}
175175
Value type: ${diagnosticInfo.valueType}`;
176-
if (this.state.ufdMessages.length > 0) {
177-
// limit speakingWhileMicrophoneIsMuted diagnostic until another diagnostic is received
178-
if (diagnosticInfo.diagnostic === 'speakingWhileMicrophoneIsMuted' && this.state.ufdMessages[0].includes('speakingWhileMicrophoneIsMuted')) {
179-
console.info(rmsg);
180-
return;
181-
}
182-
this.setState({ ufdMessages: [rmsg, ...this.state.ufdMessages] });
183-
} else {
184-
this.setState({ ufdMessages: [rmsg] });
185-
}
176+
this.setState(prevState => ({
177+
ufdMessages: [rmsg, ...prevState.ufdMessages]
178+
}));
186179
};
187180

188181
const remoteDiagnosticChangedListener = (diagnosticArgs) => {
@@ -193,11 +186,9 @@ export default class MakeCall extends React.Component {
193186
Value type: ${diagnosticInfo.valueType}
194187
Participant Id: ${diagnosticInfo.participantId}
195188
Participant name: ${diagnosticInfo.remoteParticipant?.displayName}`;
196-
if (this.state.ufdMessages.length > 0) {
197-
this.setState({ ufdMessages: [rmsg, ...this.state.ufdMessages] });
198-
} else {
199-
this.setState({ ufdMessages: [rmsg] });
200-
}
189+
this.setState(prevState => ({
190+
ufdMessages: [rmsg, ...prevState.ufdMessages]
191+
}));
201192
});
202193
};
203194

0 commit comments

Comments
 (0)