fix: Batch actions.
This commit is contained in:
parent
e5a170fb28
commit
4aea40d34f
|
@ -1,3 +1,4 @@
|
|||
import { batch } from 'react-redux';
|
||||
import { AnyAction } from 'redux';
|
||||
|
||||
import { IStore } from '../app/types';
|
||||
|
@ -49,11 +50,14 @@ MiddlewareRegistry.register(({ dispatch, getState }: IStore) => (next: Function)
|
|||
const stats = filterBySearchCriteria(state, speakerStats);
|
||||
const pendingReorder = getPendingReorder(state);
|
||||
|
||||
if (pendingReorder) {
|
||||
dispatch(updateSortedSpeakerStatsIds(getSortedSpeakerStatsIds(state, stats) ?? []));
|
||||
}
|
||||
batch(() => {
|
||||
if (pendingReorder) {
|
||||
dispatch(updateSortedSpeakerStatsIds(getSortedSpeakerStatsIds(state, stats) ?? []));
|
||||
}
|
||||
|
||||
dispatch(updateStats(stats));
|
||||
});
|
||||
|
||||
dispatch(updateStats(stats));
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { batch } from 'react-redux';
|
||||
|
||||
import {
|
||||
HIDDEN_PARTICIPANT_JOINED,
|
||||
HIDDEN_PARTICIPANT_LEFT,
|
||||
|
@ -64,8 +66,10 @@ MiddlewareRegistry.register(store => next => action => {
|
|||
|
||||
if (potentialTranscriberJIDs.includes(participant.id)
|
||||
&& participant.name === TRANSCRIBER_DISPLAY_NAME) {
|
||||
store.dispatch(transcriberJoined(participant.id));
|
||||
store.dispatch(hidePendingTranscribingNotification());
|
||||
batch(() => {
|
||||
store.dispatch(transcriberJoined(participant.id));
|
||||
store.dispatch(hidePendingTranscribingNotification());
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue