From 4d5332cadf5b16cb971d1cd1dc4c06625537f1a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 30 Jul 2019 15:26:30 +0200 Subject: [PATCH] rn,conference: log pin participant analytics events also on mobile --- react/features/base/conference/middleware.js | 41 +++++++++----------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/react/features/base/conference/middleware.js b/react/features/base/conference/middleware.js index deb5cc94a..0b285672d 100644 --- a/react/features/base/conference/middleware.js +++ b/react/features/base/conference/middleware.js @@ -435,31 +435,28 @@ function _pinParticipant({ getState }, next, action) { const participants = state['features/base/participants']; const id = action.participant.id; const participantById = getParticipantById(participants, id); + const pinnedParticipant = getPinnedParticipant(participants); + const actionName = id ? ACTION_PINNED : ACTION_UNPINNED; + const local + = (participantById && participantById.local) + || (!id && pinnedParticipant && pinnedParticipant.local); + let participantIdForEvent; - if (typeof APP !== 'undefined') { - const pinnedParticipant = getPinnedParticipant(participants); - const actionName = id ? ACTION_PINNED : ACTION_UNPINNED; - const local - = (participantById && participantById.local) - || (!id && pinnedParticipant && pinnedParticipant.local); - let participantIdForEvent; - - if (local) { - participantIdForEvent = local; - } else { - participantIdForEvent = actionName === ACTION_PINNED - ? id : pinnedParticipant && pinnedParticipant.id; - } - - sendAnalytics(createPinnedEvent( - actionName, - participantIdForEvent, - { - local, - 'participant_count': conference.getParticipantCount() - })); + if (local) { + participantIdForEvent = local; + } else { + participantIdForEvent + = actionName === ACTION_PINNED ? id : pinnedParticipant && pinnedParticipant.id; } + sendAnalytics(createPinnedEvent( + actionName, + participantIdForEvent, + { + local, + 'participant_count': conference.getParticipantCount() + })); + return next(action); }