Spaces:
Sleeping
Sleeping
tonyliu404
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -24,6 +24,16 @@ st.set_page_config(
|
|
24 |
layout="wide"
|
25 |
)
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY")
|
28 |
mongo_uri = os.getenv("MONGO_URI_RAG_RECIPE")
|
29 |
|
|
|
24 |
layout="wide"
|
25 |
)
|
26 |
|
27 |
+
# Main App
|
28 |
+
if "theme_mode" not in st.session_state:
|
29 |
+
st.session_state.theme_mode = st.get_option("theme.base")
|
30 |
+
|
31 |
+
# Check for changes in theme mode
|
32 |
+
current_theme_mode = st.get_option("theme.base")
|
33 |
+
if current_theme_mode != st.session_state.theme_mode:
|
34 |
+
st.session_state.theme_mode = current_theme_mode
|
35 |
+
st.experimental_rerun()
|
36 |
+
|
37 |
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY")
|
38 |
mongo_uri = os.getenv("MONGO_URI_RAG_RECIPE")
|
39 |
|