diff --git a/src/sidebar_manager.py b/src/sidebar_manager.py index 400a8e8..fc9d12d 100644 --- a/src/sidebar_manager.py +++ b/src/sidebar_manager.py @@ -77,7 +77,8 @@ def initialize_session_variables(self): 'activate_camera': False, 'toggle_camera_label': "Activate camera", 'new_images': False, - 'work_around_for_broken_ui': False + 'work_around_for_broken_ui': False, + 'work_around_for_broken_ui_conversation': False, } for key, default_value in required_keys.items(): @@ -331,6 +332,10 @@ def _upload_conversation_button(self, container, conversation_key): args=(conversation_key,) ) + if session_state['work_around_for_broken_ui_conversation']: + session_state['work_around_for_broken_ui_conversation'] = False + st.rerun() + @staticmethod def _download_conversation_button(container, conversation_key): """ @@ -371,6 +376,7 @@ def _process_uploaded_conversation_file(conversation_key): """ if session_state['file_uploader_conversation']: try: + session_state['work_around_for_broken_ui_conversation'] = True # Read the uploaded CSV file into a DataFrame conversation_df = pd.read_csv(session_state['file_uploader_conversation'])