Always drain the queue unless backend is disabled
This commit is contained in:
parent
4179ec9c49
commit
59d5092158
@ -844,18 +844,16 @@ export const useEventLoop = (
|
|||||||
// Main event loop.
|
// Main event loop.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Skip if the router is not ready.
|
// Skip if the router is not ready.
|
||||||
if (!router.isReady) {
|
if (!router.isReady || isBackendDisabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (socket.current || !isStateful()) {
|
(async () => {
|
||||||
(async () => {
|
// Process all outstanding events.
|
||||||
// Process all outstanding events.
|
while (event_queue.length > 0 && !event_processing) {
|
||||||
while (event_queue.length > 0 && !event_processing) {
|
await processEvent(socket.current);
|
||||||
await processEvent(socket.current);
|
}
|
||||||
}
|
})();
|
||||||
})();
|
});
|
||||||
}
|
|
||||||
}, [socket]);
|
|
||||||
|
|
||||||
// localStorage event handling
|
// localStorage event handling
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user