Always drain the queue unless backend is disabled

This commit is contained in:
Masen Furer 2025-01-31 16:31:42 -08:00
parent 4179ec9c49
commit 59d5092158
No known key found for this signature in database
GPG Key ID: 2AE2BD5531FF94F4

View File

@ -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(() => {