mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-10 04:49:24 -03:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user