npc0 commited on
Commit
98ebb33
·
verified ·
1 Parent(s): 7d6249c

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +2 -3
src/streamlit_app.py CHANGED
@@ -949,7 +949,6 @@ def view_topic_page():
949
  current_comment_id = st.session_state.get('current_comment_id')
950
  current_comment_content = st.session_state.get('current_comment_content', "Loading comments...")
951
  comment_history = st.session_state.get('comment_history', "")
952
- show_new_area_message = st.session_state.get('_show_new_area_message', True)
953
 
954
  if not topic_id:
955
  st.warning("No topic selected. Returning to home.")
@@ -1082,7 +1081,7 @@ def view_topic_page():
1082
 
1083
  if current_comment_id: # Only show voting if there's a comment to vote on
1084
  # Display comment history and the current comment with the random intro
1085
- if show_new_area_message == True:
1086
  _, user_ids = get_user_cluster_label(user_id, get_ttl_hash(10))
1087
  new_area_name, desc = name_user_group(user_ids, topic_id)
1088
  for statm in [
@@ -1150,8 +1149,8 @@ def view_topic_page():
1150
  # Pass the current topic_id to share_wisdom if needed, though it's not currently used there.
1151
  st.markdown(random.choice(prompts))
1152
  new_comment_text = st.text_area("Your Insight that different from others above (Empty to skip)", key="tmp_new_comment_input")
 
1153
  if st.button("Share Your Wisdom"):
1154
- st.session_state.handling_vote = True # lock
1155
  if new_comment_text and len(new_comment_text.strip()):
1156
  user_email = st.session_state.get('user_email', '')
1157
  user_id = find_or_create_user(user_email) # Ensure user exists
 
949
  current_comment_id = st.session_state.get('current_comment_id')
950
  current_comment_content = st.session_state.get('current_comment_content', "Loading comments...")
951
  comment_history = st.session_state.get('comment_history', "")
 
952
 
953
  if not topic_id:
954
  st.warning("No topic selected. Returning to home.")
 
1081
 
1082
  if current_comment_id: # Only show voting if there's a comment to vote on
1083
  # Display comment history and the current comment with the random intro
1084
+ if st.session_state.get('_show_new_area_message', True):
1085
  _, user_ids = get_user_cluster_label(user_id, get_ttl_hash(10))
1086
  new_area_name, desc = name_user_group(user_ids, topic_id)
1087
  for statm in [
 
1149
  # Pass the current topic_id to share_wisdom if needed, though it's not currently used there.
1150
  st.markdown(random.choice(prompts))
1151
  new_comment_text = st.text_area("Your Insight that different from others above (Empty to skip)", key="tmp_new_comment_input")
1152
+ st.session_state.handling_vote = True # lock
1153
  if st.button("Share Your Wisdom"):
 
1154
  if new_comment_text and len(new_comment_text.strip()):
1155
  user_email = st.session_state.get('user_email', '')
1156
  user_id = find_or_create_user(user_email) # Ensure user exists