Explorar o código

ignore events before client handshake

Falko Schindler %!s(int64=2) %!d(string=hai) anos
pai
achega
7c5f32aae5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      nicegui/nicegui.py

+ 1 - 1
nicegui/nicegui.py

@@ -105,7 +105,7 @@ async def handle_disconnect(sid: str) -> None:
 @sio.on('event')
 def handle_event(sid: str, msg: Dict) -> None:
     client = get_client(sid)
-    if not client:
+    if not client or not client.has_socket_connection:
         return
     with client:
         sender = client.elements.get(msg['id'])