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