Replies: 1 comment
-
Try initializing those state variables at app startup, and then just assign them in the callback: state.setdefault("active_ui", "A")
state.setdefault("active_view, "A")
def check_acc(**kwargs):
db = get_database()
with state:
state.active_ui = "A"
state.active_view = "A"
ctrl.on_client_connected(check_acc) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I want to run a method to get my database once client connected and then change my active view and ui, but state doesn't interact with my ui. My simplified code is as follows:
def check_acc(**kwargs):
db = get_database()
state.setdefault("active_ui", "A")
state.setdefault("active_view, "A")
ctrl.on_client_connected(check_acc)
Cloud someone please help me with this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions