make sure events are not queued for server side events particularly ones that call queueEvents(clear_local_storage, clear_cookies, remove_local_storage, remove_cookies) when the app is stateless(no ws)

This commit is contained in:
Elijah 2024-06-13 06:16:02 +00:00
parent 6437067de8
commit 13b041ce5d

View File

@ -281,6 +281,12 @@ export const applyRestEvent = async (event, socket) => {
* @param socket The socket object to send the event on.
*/
export const queueEvents = async (events, socket) => {
// Only proceed if the socket is up, otherwise we throw the event into the void
if (!socket) {
return;
}
event_queue.push(...events);
await processEvent(socket.current);
};