Skip to content

Commit 876c8e4

Browse files
Fix decentralized event handlers with parameters
Co-Authored-By: khaleel@reflex.dev <khaleel.aladhami@gmail.com>
1 parent 5825564 commit 876c8e4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

reflex/event.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,8 +2213,12 @@ def wrapper(
22132213
setattr(handler, BACKGROUND_TASK_MARKER, True)
22142214
# Mark the function as a decentralized event handler
22152215
setattr(func, DECENTRALIZED_EVENT_MARKER, True)
2216-
# Return the original function so it can be called normally
2217-
return func # pyright: ignore [reportReturnType]
2216+
2217+
# Create a wrapped version that can handle parameters
2218+
wrapped = wrap_decentralized_handler(func)
2219+
2220+
# Return the wrapped function instead of the original
2221+
return wrapped # pyright: ignore [reportReturnType]
22182222

22192223
if func is not None:
22202224
return wrapper(func)

0 commit comments

Comments
 (0)