Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always treat the call_script callback as a string of JS code #3521

Merged
merged 3 commits into from
Jun 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Always treat the call_script callback as a string of JS code
The handler for _call_script always calls `eval` on the `callback` string
anyway, and this allows the callback to be specified for backend-originated
call_script as well as frontend (triggered) call_script.

Fix #3520
  • Loading branch information
masenf committed Jun 19, 2024
commit f059bdf934249cae837aa196e4b0e19a2ff9b831
10 changes: 6 additions & 4 deletions reflex/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,12 @@ def call_script(
callback_kwargs = {}
if callback is not None:
callback_kwargs = {
"callback": format.format_queue_events(
callback,
args_spec=lambda result: [result],
)
"callback": str(
format.format_queue_events(
callback,
args_spec=lambda result: [result],
),
),
}
return server_side(
"_call_script",
Expand Down