File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -443,6 +443,8 @@ def __post_init__(self):
443443 "rx.BaseState cannot be subclassed directly. Use rx.State instead"
444444 )
445445
446+ get_config (reload = True )
447+
446448 if "breakpoints" in self .style :
447449 set_breakpoints (self .style .pop ("breakpoints" ))
448450
Original file line number Diff line number Diff line change 1111from reflex .components .core .banner import has_connection_errors
1212from reflex .components .core .cond import cond
1313from reflex .constants import Endpoint
14+ from reflex .utils .decorator import once
1415
15- redirect_script = """
16+
17+ @once
18+ def redirect_script () -> str :
19+ """Get the redirect script for Github Codespaces.
20+
21+ Returns:
22+ The redirect script as a string.
23+ """
24+ return """
1625const thisUrl = new URL(window.location.href);
1726const params = new URLSearchParams(thisUrl.search)
1827
@@ -61,7 +70,7 @@ def codespaces_auto_redirect() -> list[Component]:
6170 A list containing the conditional redirect component, or empty list.
6271 """
6372 if is_running_in_codespaces ():
64- return [cond (has_connection_errors , Script .create (redirect_script ))]
73+ return [cond (has_connection_errors , Script .create (redirect_script () ))]
6574 return []
6675
6776
@@ -87,5 +96,5 @@ async def auth_codespace() -> HTMLResponse:
8796 </body>
8897 </html>
8998 """
90- % redirect_script
99+ % redirect_script ()
91100 )
Original file line number Diff line number Diff line change 1111def ExtraOverlay ():
1212 import reflex as rx
1313
14- rx .config .get_config ().extra_overlay_function = "reflex.components.moment.moment"
15-
1614 def index ():
1715 return rx .vstack (
1816 rx .el .input (
@@ -26,6 +24,7 @@ def index():
2624 )
2725
2826 app = rx .App ()
27+ rx .config .get_config ().extra_overlay_function = "reflex.components.moment.moment"
2928 app .add_page (index )
3029
3130
You can’t perform that action at this time.
0 commit comments