diff --git a/react/features/speaker-stats/components/SpeakerStats.js b/react/features/speaker-stats/components/SpeakerStats.js index ea2573401d875..d3342883c3b69 100644 --- a/react/features/speaker-stats/components/SpeakerStats.js +++ b/react/features/speaker-stats/components/SpeakerStats.js @@ -10,7 +10,7 @@ import { connect } from '../../base/redux'; import { escapeRegexp } from '../../base/util'; import { initUpdateStats, initSearch } from '../actions'; import { SPEAKER_STATS_RELOAD_INTERVAL } from '../constants'; -import { getSpeakerStats } from '../functions'; +import { getSpeakerStats, getSearchCriteria } from '../functions'; import SpeakerStatsItem from './SpeakerStatsItem'; import SpeakerStatsLabels from './SpeakerStatsLabels'; @@ -216,7 +216,8 @@ class SpeakerStats extends Component { * @private * @returns {{ * _localDisplayName: ?string, - * _stats: Object + * _stats: Object, + * _criteria: string, * }} */ function _mapStateToProps(state) { @@ -230,7 +231,8 @@ function _mapStateToProps(state) { * @type {string|undefined} */ _localDisplayName: localParticipant && localParticipant.name, - _stats: getSpeakerStats(state) + _stats: getSpeakerStats(state), + _criteria: getSearchCriteria(state) }; } diff --git a/react/features/speaker-stats/functions.js b/react/features/speaker-stats/functions.js index ecd81899de19b..c2746bd2a68a3 100644 --- a/react/features/speaker-stats/functions.js +++ b/react/features/speaker-stats/functions.js @@ -2,7 +2,7 @@ import _ from 'lodash'; -import { getLocalParticipant, getParticipantById, PARTICIPANT_ROLE } from '../base/participants'; +import { getParticipantById, PARTICIPANT_ROLE } from '../base/participants'; import { objectSort } from '../base/util'; /** @@ -129,14 +129,6 @@ function getEnhancedStatsForOrdering(state, stats, orderConfig) { for (const id in stats) { if (stats[id].hasOwnProperty('_hasLeft') && !stats[id].hasLeft()) { - if (orderConfig.includes('name')) { - const localParticipant = getLocalParticipant(state); - - if (stats[id].isLocalStats()) { - stats[id].setDisplayName(localParticipant.name); - } - } - if (orderConfig.includes('role')) { const participant = getParticipantById(state, stats[id].getUserId()); diff --git a/react/features/speaker-stats/reducer.js b/react/features/speaker-stats/reducer.js index 29aff93cca50a..bfd163d5b03e2 100644 --- a/react/features/speaker-stats/reducer.js +++ b/react/features/speaker-stats/reducer.js @@ -96,7 +96,7 @@ function _updateStats(state, { stats }) { {}, state, { - stats: finalStats, + stats: { ...finalStats }, pendingReorder: false }, );