Skip to content

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

fix: Fix speaker stats search dependency and remove duplicate logic #9751 (#10045)

dimitardelchev937936117fcbe3
diff --git a/react/features/speaker-stats/components/SpeakerStats.js b/react/features/speaker-stats/components/SpeakerStats.js
index ea2573401d..d3342883c3 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<Props> {
* @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 ecd81899de..c2746bd2a6 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 29aff93cca..bfd163d5b0 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
},
);