浏览代码

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 年前
父节点
当前提交
7936117fcb
没有帐户链接到提交者的电子邮件

+ 5
- 3
react/features/speaker-stats/components/SpeakerStats.js 查看文件

10
 import { escapeRegexp } from '../../base/util';
10
 import { escapeRegexp } from '../../base/util';
11
 import { initUpdateStats, initSearch } from '../actions';
11
 import { initUpdateStats, initSearch } from '../actions';
12
 import { SPEAKER_STATS_RELOAD_INTERVAL } from '../constants';
12
 import { SPEAKER_STATS_RELOAD_INTERVAL } from '../constants';
13
-import { getSpeakerStats } from '../functions';
13
+import { getSpeakerStats, getSearchCriteria } from '../functions';
14
 
14
 
15
 import SpeakerStatsItem from './SpeakerStatsItem';
15
 import SpeakerStatsItem from './SpeakerStatsItem';
16
 import SpeakerStatsLabels from './SpeakerStatsLabels';
16
 import SpeakerStatsLabels from './SpeakerStatsLabels';
216
  * @private
216
  * @private
217
  * @returns {{
217
  * @returns {{
218
  *     _localDisplayName: ?string,
218
  *     _localDisplayName: ?string,
219
- *     _stats: Object
219
+ *     _stats: Object,
220
+ *     _criteria: string,
220
  * }}
221
  * }}
221
  */
222
  */
222
 function _mapStateToProps(state) {
223
 function _mapStateToProps(state) {
230
          * @type {string|undefined}
231
          * @type {string|undefined}
231
          */
232
          */
232
         _localDisplayName: localParticipant && localParticipant.name,
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
 
2
 
3
 import _ from 'lodash';
3
 import _ from 'lodash';
4
 
4
 
5
-import { getLocalParticipant, getParticipantById, PARTICIPANT_ROLE } from '../base/participants';
5
+import { getParticipantById, PARTICIPANT_ROLE } from '../base/participants';
6
 import { objectSort } from '../base/util';
6
 import { objectSort } from '../base/util';
7
 
7
 
8
 /**
8
 /**
129
 
129
 
130
     for (const id in stats) {
130
     for (const id in stats) {
131
         if (stats[id].hasOwnProperty('_hasLeft') && !stats[id].hasLeft()) {
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
             if (orderConfig.includes('role')) {
132
             if (orderConfig.includes('role')) {
141
                 const participant = getParticipantById(state, stats[id].getUserId());
133
                 const participant = getParticipantById(state, stats[id].getUserId());
142
 
134
 

+ 1
- 1
react/features/speaker-stats/reducer.js 查看文件

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

正在加载...
取消
保存