diff --git a/editor/app.py b/editor/app.py index 4fe919e7f..0bec32785 100644 --- a/editor/app.py +++ b/editor/app.py @@ -56,6 +56,8 @@ def _back_to_menu(): def _logout(): """Logs the user out.""" st.cache_data.clear() + get_cached_user.clear() + st.session_state[User] = None _back_to_menu() @@ -70,7 +72,9 @@ def _logout(): col3.button("Menu", on_click=_back_to_menu) -if st.session_state.get(CurrentProject): +should_display_editor = bool(st.session_state.get(CurrentProject)) + +if should_display_editor: render_editor() else: render_splash() diff --git a/editor/components/tabs/__init__.py b/editor/components/tabs/__init__.py index c7242ceee..77c58d174 100644 --- a/editor/components/tabs/__init__.py +++ b/editor/components/tabs/__init__.py @@ -2,6 +2,8 @@ import streamlit.components.v1 as components +from core.constants import OVERVIEW + # Create a _RELEASE constant. We'll set this to False while we're developing # the component, and True when we're ready to package and distribute it. _RELEASE = True @@ -17,12 +19,12 @@ _component_func = components.declare_component("tabs_component", path=build_dir) -def render_tabs(tabs: list[str], selected_tab: int, key=None): +def render_tabs(tabs: list[str], selected_tab: int, json: str | None, key=None): """Create a new instance of "tabs_component". Args: - nodes: The nodes to render in the tree. Nodes are dictionaries with keys `name` - (unique identifier), `type` and `parent` (referencing another name). + tabs: The tabs to render in the component. + selected_tab: The selected tab. key: An optional key that uniquely identifies this component. If this is None, and the component's arguments are changed, the component will be re-mounted in the Streamlit frontend and lose its current state. @@ -33,6 +35,10 @@ def render_tabs(tabs: list[str], selected_tab: int, key=None): frontend.) """ component_value = _component_func( - tabs=tabs, selected_tab=selected_tab, key=key, default=0 + tabs=tabs, + selected_tab=selected_tab, + json=json, + key=key, + default=OVERVIEW, ) return component_value diff --git a/editor/components/tabs/frontend/build/asset-manifest.json b/editor/components/tabs/frontend/build/asset-manifest.json index 7d4eddc3a..30248f1bc 100644 --- a/editor/components/tabs/frontend/build/asset-manifest.json +++ b/editor/components/tabs/frontend/build/asset-manifest.json @@ -1,10 +1,10 @@ { "files": { - "main.js": "./static/js/main.d73ef39a.js", + "main.js": "./static/js/main.716a0ab4.js", "index.html": "./index.html", - "main.d73ef39a.js.map": "./static/js/main.d73ef39a.js.map" + "main.716a0ab4.js.map": "./static/js/main.716a0ab4.js.map" }, "entrypoints": [ - "static/js/main.d73ef39a.js" + "static/js/main.716a0ab4.js" ] } \ No newline at end of file diff --git a/editor/components/tabs/frontend/build/index.html b/editor/components/tabs/frontend/build/index.html index 7b16209b9..5566c25df 100644 --- a/editor/components/tabs/frontend/build/index.html +++ b/editor/components/tabs/frontend/build/index.html @@ -1 +1 @@ -