client_state: create Var from value when pushing from backend (#4474)
This ensures that the value is properly escaped/formatted for direct use in javascript code.
This commit is contained in:
parent
d75a708e6b
commit
95eb663347
@ -242,4 +242,5 @@ class ClientStateVar(Var):
|
||||
"""
|
||||
if not self._global_ref:
|
||||
raise ValueError("ClientStateVar must be global to push the value.")
|
||||
value = Var.create(value)
|
||||
return run_script(f"{_client_state_ref(self._setter_name)}({value})")
|
||||
|
Loading…
Reference in New Issue
Block a user