From 751d9a9b8ebf437cefb9f2d31f3cf99a70e0cc8c Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty Date: Thu, 19 Aug 2021 15:41:17 -0400 Subject: [PATCH] fix(KeyboardShortcut): pin the correct participants when number keys are used. --- react/features/filmstrip/actions.web.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/react/features/filmstrip/actions.web.js b/react/features/filmstrip/actions.web.js index 2c7661923..ceb2b7e3d 100644 --- a/react/features/filmstrip/actions.web.js +++ b/react/features/filmstrip/actions.web.js @@ -1,7 +1,7 @@ // @flow import type { Dispatch } from 'redux'; -import { getLocalParticipant, getRemoteParticipants, pinParticipant } from '../base/participants'; +import { getLocalParticipant, getParticipantById, pinParticipant } from '../base/participants'; import { SET_HORIZONTAL_VIEW_DIMENSIONS, @@ -130,9 +130,12 @@ export function setHorizontalViewDimensions() { export function clickOnVideo(n: number) { return (dispatch: Function, getState: Function) => { const state = getState(); - const participants = [ getLocalParticipant(state), ...getRemoteParticipants(state).values() ]; - const nThParticipant = participants[n]; - const { id, pinned } = nThParticipant; + const { id: localId } = getLocalParticipant(state); + + // Use the reordered list of participants. + const { remoteParticipants } = state['features/filmstrip']; + const participants = [ localId, ...remoteParticipants ]; + const { id, pinned } = getParticipantById(state, participants[n]); dispatch(pinParticipant(pinned ? null : id)); };