From 3e048902336922cb6d7a357ec051b813f5a3a5d8 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sat, 4 Feb 2023 16:44:21 -0500 Subject: [PATCH] fix double event trigger this can cause endless loop on webui startup --- scripts/images_history.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/images_history.py b/scripts/images_history.py index 4440b17..0298d73 100644 --- a/scripts/images_history.py +++ b/scripts/images_history.py @@ -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])