File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -102,11 +102,11 @@ def add_hooks(self) -> list[str | Var]:
102102 toast_id = "websocket-error"
103103 target_url = WebsocketTargetURL .create ()
104104 config = get_config ()
105+ is_dev_mode = environment .REFLEX_ENV_MODE .get ().value == constants .Env .DEV
105106 props = ToastProps (
106107 description = LiteralVar .create (
107108 f"Check if server is reachable at { target_url } "
108- if environment .REFLEX_ENV_MODE .get ().value == constants .Env .DEV
109- or not config .connection_error_message
109+ if is_dev_mode or not config .connection_error_message
110110 else config .connection_error_message
111111 ),
112112 close_button = True ,
@@ -140,8 +140,7 @@ def add_hooks(self) -> list[str | Var]:
140140 else :
141141 loading_message = Var .create (
142142 f"Cannot connect to server: { connection_error } ."
143- if environment .REFLEX_ENV_MODE .get ().value == constants .Env .DEV
144- or not config .connection_error_message
143+ if is_dev_mode or not config .connection_error_message
145144 else ""
146145 )
147146 toast_var = Var (
You can’t perform that action at this time.
0 commit comments