fix(autocomplete): reactively refresh lora syntax format cache on settings change (#917)

The autocomplete module cached the lora_syntax_format value at module load
but never updated it when the setting changed, causing autocomplete to
always insert legacy A1111 format even when 'full path' was configured.

- Expose refreshLoraSyntaxFormat() to re-fetch the setting from the API
- Listen for cross-tab 'storage' events to react to settings saved in
  the standalone web UI
- Listen for 'visibilitychange' to refresh when the user switches back
  to the ComfyUI tab
- Wire SettingsManager.saveSetting() to set a localStorage key when
  lora_syntax_format changes, triggering the storage event
This commit is contained in:
Will Miao
2026-05-25 22:03:56 +08:00
parent 5e1cf68bbd
commit 5dd8b96422
2 changed files with 47 additions and 4 deletions

View File

@@ -295,6 +295,13 @@ export class SettingsManager {
// Update state
state.global.settings[settingKey] = value;
if (settingKey === 'lora_syntax_format') {
try {
localStorage.setItem('lm:lora-syntax-format-changed', Date.now().toString());
} catch (_) {
}
}
if (!this.isBackendSetting(settingKey)) {
return;
}