From bbb0aadddf459d4ba0ac5264e96cf9bfd27a0675 Mon Sep 17 00:00:00 2001 From: Alex Heller Date: Mon, 5 Jun 2023 04:26:07 +0200 Subject: [PATCH] Removed old resetting to previous values This is due to a change in `_js` which lead to the instant updates breaking :( Need to reinvestigate how to actually fix this. For now the broken feature got replaced with a working, but sloooow solution (updates one by one when resetting) --- javascript/ui.js | 10 ---------- modules/ui.py | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/javascript/ui.js b/javascript/ui.js index bbfbb18fd..7ae391ec1 100644 --- a/javascript/ui.js +++ b/javascript/ui.js @@ -371,11 +371,6 @@ function markIfModified(setting_name, value) { tab_nav_indicator.title += `${unsaved.size} new default value${unsaved.size > 1 ? 's':''} (not yet saved).`; } -function onSettingComponentChanged(setting_name, value) { - markIfModified(setting_name, value) - return [] -} - function onSettingsModificationIndicatorClicked(tab_name) { opts_tabs[tab_name].changed.forEach(function(setting_name){ // Click each setting's modification indicator @@ -383,11 +378,6 @@ function onSettingsModificationIndicatorClicked(tab_name) { }) } -function onModificationIndicatorClicked(setting_name) { - markIfModified(setting_name, opts[setting_name]) - return JSON.parse(JSON.stringify(opts[setting_name])); -} - let txt2img_textarea; let img2img_textarea; const wait_time = 800; diff --git a/modules/ui.py b/modules/ui.py index 589089e5e..3684a5875 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -1300,8 +1300,8 @@ def create_ui(): res = comp(label=info.label, value=fun(), elem_id=elem_id, **(args or {})) if not is_quicksettings: - res.change(fn=None, inputs=res, _js=f'(val) => onSettingComponentChanged("{key}", val)') - dirty_indicator.click(fn=None, outputs=res, _js=f'() => onModificationIndicatorClicked("{key}")') + res.change(fn=None, inputs=res, _js=f'(val) => markIfModified("{key}", val)') + dirty_indicator.click(fn=lambda: getattr(opts, key), outputs=res, show_progress=False) dirtyable_setting.__exit__() return res