tonyliu404 commited on
Commit
e545e34
·
verified ·
1 Parent(s): 5cde785

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
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