From 8c9ba325caf676205d382e41afb355fec0c819a4 Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Fri, 11 Jan 2019 10:08:05 -0800 Subject: [PATCH] fix(pinning): send a participant id on unpin Analytics is erroring when unpinning because the logged event sends null for the objectId. The objectId should be the id of the person getting unpinned. --- react/features/base/conference/middleware.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/react/features/base/conference/middleware.js b/react/features/base/conference/middleware.js index 23eef2506..2d5c3c095 100644 --- a/react/features/base/conference/middleware.js +++ b/react/features/base/conference/middleware.js @@ -390,10 +390,18 @@ function _pinParticipant({ getState }, next, action) { 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, - local ? 'local' : id, + participantIdForEvent, { local, 'participant_count': conference.getParticipantCount()