Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,9 +93,13 @@ if submit_button_left:
|
|
| 93 |
advice = st.text_area(" ", height=100)
|
| 94 |
submit_button_right = st.button("조언 제출하기")
|
| 95 |
|
| 96 |
-
if
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
advice = st.text_area(" ", height=100)
|
| 94 |
submit_button_right = st.button("조언 제출하기")
|
| 95 |
|
| 96 |
+
if submit_button_right:
|
| 97 |
+
if not st.session_state.get('submitted', False): # 'submitted' 상태가 False인 경우에만 실행
|
| 98 |
+
if advice.strip(): # 사용자가 실제로 조언을 입력했는지 확인
|
| 99 |
+
record_advice("선택된 고민 내용", advice) # Google Sheets에 기록
|
| 100 |
+
st.session_state['submitted'] = True # 'submitted' 상태를 True로 설정하여 중복 제출 방지
|
| 101 |
+
st.success("조언이 성공적으로 제출되었습니다!")
|
| 102 |
+
else:
|
| 103 |
+
st.error("조언을 입력해주세요.") # 사용자가 조언을 입력하지 않은 경우 에러 메시지 출력
|
| 104 |
+
else:
|
| 105 |
+
st.warning("이미 제출되었습니다.") # 이미 제출된 경우 경고 메시지 출력
|