fix double event trigger

this can cause endless loop on webui startup
pull/14/head
Vladimir Mandic 2023-02-04 16:44:21 -05:00 committed by GitHub
parent be513d619b
commit 3e04890233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -114,6 +114,8 @@ def read_path_recorder(path_recorder, path_recorder_formatted):
return path_recorder, path_recorder_formatted
def pure_path(path):
if path == []:
return path, 0
match = re.search(r" \[(\d+)\]$", path)
if match:
path = path[:match.start()]
@ -593,7 +595,7 @@ def create_tab(tabname):
change_dir_outputs = [warning_box, main_panel, img_path_history, path_recorder, load_switch, img_path, img_path_depth]
img_path.submit(change_dir, inputs=[img_path, path_recorder, load_switch, img_path_history, img_path_depth, img_path], outputs=change_dir_outputs)
img_path_history.change(change_dir, inputs=[img_path_history, path_recorder, load_switch, img_path_history, img_path_depth, img_path], outputs=change_dir_outputs)
img_path_history.change(history2path, inputs=[img_path_history], outputs=[img_path])
# img_path_history.change(history2path, inputs=[img_path_history], outputs=[img_path])
#delete
delete.click(delete_image, inputs=[delete_num, img_file_name, filenames, image_index, visible_img_num], outputs=[filenames, delete_num, visible_img_num])