Fix frontend event infinite loop (#1207)
This commit is contained in:
parent
ab84c78e6e
commit
b37560cbeb
@ -166,10 +166,10 @@ export const processEvent = async (
|
|||||||
setResult({ ...result, processing: true });
|
setResult({ ...result, processing: true });
|
||||||
|
|
||||||
// Apply the next event in the queue.
|
// Apply the next event in the queue.
|
||||||
const event = state.events[0];
|
const event = state.events.shift();
|
||||||
|
|
||||||
// Set new events to avoid reprocessing the same event.
|
// Set new events to avoid reprocessing the same event.
|
||||||
setState(state => ({ ...state, events: state.events.slice(1) }));
|
setState(state => ({ ...state, events: state.events }));
|
||||||
|
|
||||||
// Process events with handlers via REST and all others via websockets.
|
// Process events with handlers via REST and all others via websockets.
|
||||||
let eventSent = false;
|
let eventSent = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user