The client_exited life cycle event seems to be called for all class instances #475
-
We have a class that opens on a new route that the main application calls using Snippet: @TrameApp()
class Viewer:
def __init__(self, template_name):
server = get_server(client_type="vue3")
with VAppLayout(server, template_name=template_name):
...
@life_cycle.client_exited
def cleanup(self):
print(id(self)) # This prints multiple different ids Is there a way to know which window was closed by the client or to only attach the listener to the current class instance? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 13 replies
-
Those life_cycle events are bound to a server instance, hence the issue. |
Beta Was this translation helpful? Give feedback.
trame-client>=3.0.1
added a exit= event on which you can bind a method that will be tight to your UI instance.See this example for reference.