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.
useEffect(() => {
// Skip if the router is not ready.
if (!router.isReady) {
if (!router.isReady || isBackendDisabled()) {
return;
}
if (socket.current || !isStateful()) {
(async () => {
// Process all outstanding events.
while (event_queue.length > 0 && !event_processing) {
await processEvent(socket.current);
}
})();
}
}, [socket]);
(async () => {
// Process all outstanding events.
while (event_queue.length > 0 && !event_processing) {
await processEvent(socket.current);
}
})();
});
// localStorage event handling
useEffect(() => {