Просмотр исходного кода

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

* Fix speaker stats search dependency and remove duplicate logic #9751

* Fix speaker stats component render on update #9751
master
dimitardelchev93 3 лет назад
Родитель
Сommit
7936117fcb
Аккаунт пользователя с таким Email не найден

+ 5
- 3
react/features/speaker-stats/components/SpeakerStats.js Просмотреть файл

@@ -10,7 +10,7 @@ import { connect } from '../../base/redux';
10 10
 import { escapeRegexp } from '../../base/util';
11 11
 import { initUpdateStats, initSearch } from '../actions';
12 12
 import { SPEAKER_STATS_RELOAD_INTERVAL } from '../constants';
13
-import { getSpeakerStats } from '../functions';
13
+import { getSpeakerStats, getSearchCriteria } from '../functions';
14 14
 
15 15
 import SpeakerStatsItem from './SpeakerStatsItem';
16 16
 import SpeakerStatsLabels from './SpeakerStatsLabels';
@@ -216,7 +216,8 @@ class SpeakerStats extends Component<Props> {
216 216
  * @private
217 217
  * @returns {{
218 218
  *     _localDisplayName: ?string,
219
- *     _stats: Object
219
+ *     _stats: Object,
220
+ *     _criteria: string,
220 221
  * }}
221 222
  */
222 223
 function _mapStateToProps(state) {
@@ -230,7 +231,8 @@ function _mapStateToProps(state) {
230 231
          * @type {string|undefined}
231 232
          */
232 233
         _localDisplayName: localParticipant && localParticipant.name,
233
-        _stats: getSpeakerStats(state)
234
+        _stats: getSpeakerStats(state),
235
+        _criteria: getSearchCriteria(state)
234 236
     };
235 237
 }
236 238
 

+ 1
- 9
react/features/speaker-stats/functions.js Просмотреть файл

@@ -2,7 +2,7 @@
2 2
 
3 3
 import _ from 'lodash';
4 4
 
5
-import { getLocalParticipant, getParticipantById, PARTICIPANT_ROLE } from '../base/participants';
5
+import { getParticipantById, PARTICIPANT_ROLE } from '../base/participants';
6 6
 import { objectSort } from '../base/util';
7 7
 
8 8
 /**
@@ -129,14 +129,6 @@ function getEnhancedStatsForOrdering(state, stats, orderConfig) {
129 129
 
130 130
     for (const id in stats) {
131 131
         if (stats[id].hasOwnProperty('_hasLeft') && !stats[id].hasLeft()) {
132
-            if (orderConfig.includes('name')) {
133
-                const localParticipant = getLocalParticipant(state);
134
-
135
-                if (stats[id].isLocalStats()) {
136
-                    stats[id].setDisplayName(localParticipant.name);
137
-                }
138
-            }
139
-
140 132
             if (orderConfig.includes('role')) {
141 133
                 const participant = getParticipantById(state, stats[id].getUserId());
142 134
 

+ 1
- 1
react/features/speaker-stats/reducer.js Просмотреть файл

@@ -96,7 +96,7 @@ function _updateStats(state, { stats }) {
96 96
         {},
97 97
         state,
98 98
         {
99
-            stats: finalStats,
99
+            stats: { ...finalStats },
100 100
             pendingReorder: false
101 101
         },
102 102
     );

Загрузка…
Отмена
Сохранить