Skip to content

Commit

Permalink
warn if notification can not be displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Oct 6, 2023
1 parent 9b4e46d commit 8067680
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nicegui/functions/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +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)
outbox.enqueue_message('notify', options, globals.get_client().id)
if not globals.get_client().has_socket_connection:
globals.log.warning(f'notification "{message}" was ignored because the client is not connected')
else:
outbox.enqueue_message('notify', options, globals.get_client().id)

0 comments on commit 8067680

Please sign in to comment.