Ronio Jerico Roque commited on
Commit
55ebf67
·
1 Parent(s): a5cba28

Initialize 'analysis_completed' session state variable and reset on analyze button click

Browse files
Files changed (1) hide show
  1. pages/home.py +3 -0
pages/home.py CHANGED
@@ -40,6 +40,8 @@ class DigitalFootprintDashboard:
40
  st.session_state['nature'] = ''
41
  if 'analyze' not in st.session_state:
42
  st.session_state['analyze'] = ''
 
 
43
 
44
  async def create_row1(self):
45
  """Create the first row with four columns"""
@@ -56,6 +58,7 @@ class DigitalFootprintDashboard:
56
 
57
  self.analyze_button = st.button("Analyze", icon="✨", use_container_width=True)
58
  if self.analyze_button == True:
 
59
  st.switch_page("pages/analyzing_page.py")
60
  else:
61
  hide_button()
 
40
  st.session_state['nature'] = ''
41
  if 'analyze' not in st.session_state:
42
  st.session_state['analyze'] = ''
43
+ if 'analysis_completed' not in st.session_state:
44
+ st.session_state.analysis_completed = False
45
 
46
  async def create_row1(self):
47
  """Create the first row with four columns"""
 
58
 
59
  self.analyze_button = st.button("Analyze", icon="✨", use_container_width=True)
60
  if self.analyze_button == True:
61
+ st.session_state.analysis_completed = False
62
  st.switch_page("pages/analyzing_page.py")
63
  else:
64
  hide_button()