From b7715b0a0cf3f2b4bfceaf5f4b7aad0df928a28a Mon Sep 17 00:00:00 2001 From: Manuel Schmid <9307310+mashb1t@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:33:28 +0100 Subject: [PATCH] fix: prevents outdated history log link after midnight (#1979) * feat: update history link date after each generation prevents outdated date in link after midnight * delay importing of modules.config (#2195) * fix: disable queue for initial queue loading --------- Co-authored-by: rsl8 <138326583+rsl8@users.noreply.github.com> --- webui.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/webui.py b/webui.py index a3de1498..b9b620d2 100644 --- a/webui.py +++ b/webui.py @@ -255,8 +255,14 @@ with shared.gradio_root: seed_random.change(random_checked, inputs=[seed_random], outputs=[image_seed], queue=False, show_progress=False) - if not args_manager.args.disable_image_log: - gr.HTML(f'\U0001F4DA History Log') + def update_history_link(): + if args_manager.args.disable_image_log: + return gr.update(value='') + + return gr.update(value=f'\U0001F4DA History Log') + + history_link = gr.HTML() + shared.gradio_root.load(update_history_link, outputs=history_link, queue=False, show_progress=False) with gr.Tab(label='Style'): style_sorter.try_load_sorted_styles( @@ -586,6 +592,7 @@ with shared.gradio_root: .then(fn=generate_clicked, inputs=ctrls, outputs=[progress_html, progress_window, progress_gallery, gallery]) \ .then(lambda: (gr.update(visible=True, interactive=True), gr.update(visible=False, interactive=False), gr.update(visible=False, interactive=False), False), outputs=[generate_button, stop_button, skip_button, state_is_generating]) \ + .then(fn=update_history_link, outputs=history_link) \ .then(fn=lambda: None, _js='playNotification').then(fn=lambda: None, _js='refresh_grid_delayed') for notification_file in ['notification.ogg', 'notification.mp3']: