|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+import { batch } from 'react-redux';
|
|
1
|
2
|
import { AnyAction } from 'redux';
|
|
2
|
3
|
|
|
3
|
4
|
import { IStore } from '../app/types';
|
|
|
@@ -49,11 +50,14 @@ MiddlewareRegistry.register(({ dispatch, getState }: IStore) => (next: Function)
|
|
49
|
50
|
const stats = filterBySearchCriteria(state, speakerStats);
|
|
50
|
51
|
const pendingReorder = getPendingReorder(state);
|
|
51
|
52
|
|
|
52
|
|
- if (pendingReorder) {
|
|
53
|
|
- dispatch(updateSortedSpeakerStatsIds(getSortedSpeakerStatsIds(state, stats) ?? []));
|
|
54
|
|
- }
|
|
|
53
|
+ batch(() => {
|
|
|
54
|
+ if (pendingReorder) {
|
|
|
55
|
+ dispatch(updateSortedSpeakerStatsIds(getSortedSpeakerStatsIds(state, stats) ?? []));
|
|
|
56
|
+ }
|
|
|
57
|
+
|
|
|
58
|
+ dispatch(updateStats(stats));
|
|
|
59
|
+ });
|
|
55
|
60
|
|
|
56
|
|
- dispatch(updateStats(stats));
|
|
57
|
61
|
}
|
|
58
|
62
|
|
|
59
|
63
|
break;
|