Skip to content

Commit

Permalink
Workaround fix to broken UI when uploading conversation and continuin…
Browse files Browse the repository at this point in the history
…g with it
  • Loading branch information
Odrec committed Jun 12, 2024
1 parent fd68d88 commit a5d8ddb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/sidebar_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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'])

Expand Down

0 comments on commit a5d8ddb

Please sign in to comment.