From a5d8ddbe501426dc1e15a2ac6d9a9a5468abd7b4 Mon Sep 17 00:00:00 2001 From: odrec Date: Wed, 12 Jun 2024 14:49:40 +0200 Subject: [PATCH] Workaround fix to broken UI when uploading conversation and continuing with it --- src/sidebar_manager.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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'])