Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt-bartscher committed Jun 14, 2024
1 parent 15089ea commit 3a994ec
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions reflex/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,29 +1118,6 @@ async def process(
"""
from reflex.utils import telemetry

# Add request data to the state.
router_data = event.router_data
router_data.update(
{
constants.RouteVar.QUERY: format.format_query_params(event.router_data),
constants.RouteVar.CLIENT_TOKEN: event.token,
constants.RouteVar.SESSION_ID: sid,
constants.RouteVar.HEADERS: headers,
constants.RouteVar.CLIENT_IP: client_ip,
}
)
# Get the state for the session exclusively.
async with app.state_manager.modify_state(event.token) as state:
# re-assign only when the value is different
if state.router_data != router_data:
# assignment will recurse into substates and force recalculation of
# dependent ComputedVar (dynamic route variables)
state.router_data = router_data
if state.router:
state.router.update(router_data)
else:
state.router = RouterData(router_data)

try:
# Add request data to the state.
router_data = event.router_data
Expand All @@ -1160,6 +1137,9 @@ async def process(
# assignment will recurse into substates and force recalculation of
# dependent ComputedVar (dynamic route variables)
state.router_data = router_data
if state.router:
state.router.update(router_data)
else:
state.router = RouterData(router_data)

# Preprocess the event.
Expand Down

0 comments on commit 3a994ec

Please sign in to comment.