Browse Source

fix typo in page_ready_handler

Falko Schindler 2 years ago
parent
commit
67c41c1904
1 changed files with 2 additions and 1 deletions
  1. 2 1
      nicegui/elements/page.py

+ 2 - 1
nicegui/elements/page.py

@@ -38,6 +38,7 @@ class Page(jp.QuasarPage):
         :param classes: tailwind classes for the container div (default: `'q-ma-md column items-start'`)
         :param css: CSS definitions
         :param on_connect: optional function or coroutine which is called for each new client connection
+        :param on_page_ready: optional function or coroutine which is called when the websocket is connected
         :param on_disconnect: optional function or coroutine which is called when a client disconnects
         """
         super().__init__()
@@ -79,7 +80,7 @@ class Page(jp.QuasarPage):
             arg_count = len(inspect.signature(self.page_ready_handler).parameters)
             is_coro = is_coroutine(self.page_ready_handler)
             if arg_count == 1:
-                await self.page_ready_handler(msg.socket) if is_coro else self.page_ready_handler(msg.socket)
+                await self.page_ready_handler(msg.websocket) if is_coro else self.page_ready_handler(msg.websocket)
             elif arg_count == 0:
                 await self.page_ready_handler() if is_coro else self.page_ready_handler()
             else: