Rathapoom commited on
Commit
1ddf11d
·
verified ·
1 Parent(s): c4b97d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -2026,8 +2026,8 @@ with col1:
2026
  if not st.session_state.current_theme:
2027
  show_theme_selection()
2028
  else:
2029
- # Show current theme and option to change
2030
- if st.button("🔄 Change Theme"):
2031
  st.session_state.current_theme = None
2032
  st.session_state.theme_story_starter = None
2033
  st.session_state.story = []
@@ -2044,14 +2044,16 @@ with col1:
2044
  </div>
2045
  """, unsafe_allow_html=True)
2046
 
 
2047
  st.text_area(
2048
  "เขียนต่อจากเรื่องราว | Continue the story:",
2049
  height=100,
2050
- key="text_input",
2051
  label_visibility="collapsed"
2052
  )
2053
 
2054
- st.button("ส่งคำตอบ | Submit", on_click=submit_story)
 
2055
 
2056
  with col2:
2057
  # 1. Feedback Section (Most Important)
 
2026
  if not st.session_state.current_theme:
2027
  show_theme_selection()
2028
  else:
2029
+ # Show current theme and option to change - เพิ่ม key ให้ปุ่ม
2030
+ if st.button("🔄 Change Theme", key="change_theme_button"):
2031
  st.session_state.current_theme = None
2032
  st.session_state.theme_story_starter = None
2033
  st.session_state.story = []
 
2044
  </div>
2045
  """, unsafe_allow_html=True)
2046
 
2047
+ # เพิ่ม key ให้ input area
2048
  st.text_area(
2049
  "เขียนต่อจากเรื่องราว | Continue the story:",
2050
  height=100,
2051
+ key="story_input_area",
2052
  label_visibility="collapsed"
2053
  )
2054
 
2055
+ # เพิ่ม key ให้ปุ่ม Submit
2056
+ st.button("ส่งคำตอบ | Submit", key="submit_story_button", on_click=submit_story)
2057
 
2058
  with col2:
2059
  # 1. Feedback Section (Most Important)