fix initial state without cv fallback (#3670)
This commit is contained in:
parent
21585867b9
commit
b7c7197f1d
@ -152,7 +152,9 @@ def compile_state(state: Type[BaseState]) -> dict:
|
||||
console.warn(
|
||||
f"Failed to compile initial state with computed vars, excluding them: {e}"
|
||||
)
|
||||
initial_state = state(_reflex_internal_init=True).dict(include_computed=False)
|
||||
initial_state = state(_reflex_internal_init=True).dict(
|
||||
initial=True, include_computed=False
|
||||
)
|
||||
return format.format_state(initial_state)
|
||||
|
||||
|
||||
|
@ -1784,7 +1784,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
||||
prop_name: self.get_value(getattr(self, prop_name))
|
||||
for prop_name in self.base_vars
|
||||
}
|
||||
if initial:
|
||||
if initial and include_computed:
|
||||
computed_vars = {
|
||||
# Include initial computed vars.
|
||||
prop_name: (
|
||||
|
Loading…
Reference in New Issue
Block a user