Falko Schindler hace 1 año
padre
commit
ba9256661c
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      nicegui/functions/notify.py

+ 3 - 3
nicegui/functions/notify.py

@@ -49,7 +49,7 @@ def notify(message: Any, *,
     options = {ARG_MAP.get(key, key): value for key, value in locals().items() if key != 'kwargs' and value is not None}
     options['message'] = str(message)
     options.update(kwargs)
-    if not globals.get_client().has_socket_connection:
-        globals.log.warning(f'notification "{message}" was ignored because the client is not connected')
-    else:
+    if globals.get_client().has_socket_connection:
         outbox.enqueue_message('notify', options, globals.get_client().id)
+    else:
+        globals.log.warning(f'Ignoring notification "{message}" because the client is not connected.')