Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

avatar: make code a bit clearer

Saúl Ibarra Corretgé69c21cbb11e9
diff --git a/react/features/base/avatar/components/Avatar.js b/react/features/base/avatar/components/Avatar.js
index d87e2d7723..ef80d0105a 100644
--- a/react/features/base/avatar/components/Avatar.js
+++ b/react/features/base/avatar/components/Avatar.js
@@ -176,11 +176,11 @@ class Avatar<P: Props> extends PureComponent<P, State> {
*/
export function _mapStateToProps(state: Object, ownProps: Props) {
const { colorBase, displayName, participantId } = ownProps;
- const _participant = participantId && getParticipantById(state, participantId);
- const _initialsBase = (_participant && _participant.name) || displayName;
+ const _participant: ?Object = participantId && getParticipantById(state, participantId);
+ const _initialsBase = _participant?.name ?? displayName;
const screenShares = state['features/video-layout'].screenShares || [];
- let _loadableAvatarUrl = _participant && _participant.loadableAvatarUrl;
+ let _loadableAvatarUrl = _participant?.loadableAvatarUrl;
if (participantId && screenShares.includes(participantId)) {
_loadableAvatarUrl = 'icon://share-desktop';