From 93fc65b2ea552b714df0820995b3c650b4e30153 Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Tue, 27 Jan 2026 13:55:16 -0800 Subject: [PATCH] Allow addition to monitored options --- eslint.config.mjs | 1 + javascript/settings.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index fddda6ca1..cd9ee3251 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -53,6 +53,7 @@ const jsConfig = defineConfig([ generateForever: 'readonly', showContributors: 'readonly', opts: 'writable', + monitorOption: 'readonly', sortUIElements: 'readonly', all_gallery_buttons: 'readonly', selected_gallery_button: 'readonly', diff --git a/javascript/settings.js b/javascript/settings.js index ed564b29c..9aa22c626 100644 --- a/javascript/settings.js +++ b/javascript/settings.js @@ -11,6 +11,10 @@ const monitoredOpts = [ { sd_backend: () => gradioApp().getElementById('refresh_sd_model_checkpoint')?.click() }, ]; +function monitorOption(option, callback) { + monitoredOpts.push({ [option]: callback }); +} + const AppyOpts = [ { compact_view: (val, old) => toggleCompact(val, old) }, { gradio_theme: (val, old) => setTheme(val, old) },