sirochild commited on
Commit
85d7fe1
·
verified ·
1 Parent(s): e5d0e7d

Upload main_app.py

Browse files
Files changed (1) hide show
  1. main_app.py +3 -3
main_app.py CHANGED
@@ -510,7 +510,6 @@ def initialize_session_state(managers, force_reset_override=False):
510
 
511
  # 重要: 初期メッセージの復元は特別な場合のみ実行
512
  restore_needed = False
513
- st.session_state.chat_initialized = True
514
  # チュートリアル保護フラグがある場合のみ初期メッセージを復元
515
  if st.session_state.get('preserve_initial_message', False):
516
  if 'chat' in st.session_state and 'messages' in st.session_state.chat:
@@ -1237,9 +1236,10 @@ def render_chat_tab_content(managers):
1237
  st.success("🔓 セーフティ解除モードに切り替えました!")
1238
  else:
1239
  st.info("🔒 セーフティ有効モードに戻しました。")
1240
-
 
1241
  st.rerun()
1242
-
1243
  # 好感度に応じた現在の色を計算する関数(スコープ問題回避のため外部定義)
1244
  def get_affection_color(affection_val):
1245
  if affection_val < 20:
 
510
 
511
  # 重要: 初期メッセージの復元は特別な場合のみ実行
512
  restore_needed = False
 
513
  # チュートリアル保護フラグがある場合のみ初期メッセージを復元
514
  if st.session_state.get('preserve_initial_message', False):
515
  if 'chat' in st.session_state and 'messages' in st.session_state.chat:
 
1236
  st.success("🔓 セーフティ解除モードに切り替えました!")
1237
  else:
1238
  st.info("🔒 セーフティ有効モードに戻しました。")
1239
+ # 状態変更後に即座にUIを更新
1240
+ st.session_state.chat_initialized = True
1241
  st.rerun()
1242
+
1243
  # 好感度に応じた現在の色を計算する関数(スコープ問題回避のため外部定義)
1244
  def get_affection_color(affection_val):
1245
  if affection_val < 20: