mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-09-20 18:51:26 -03:00
fix(settings): restore the Other Models master toggle state on load
updateOtherModelsControls() synced the sub-type checkboxes and default-root selects but never set the master toggle's checked state, and the setting_toggle macro renders no checked attribute, so after a page refresh the toggle always appeared off regardless of the saved setting.
This commit is contained in:
@@ -665,6 +665,22 @@ describe('SettingsManager other-model root selects', () => {
|
||||
expect(container.classList.contains('is-disabled')).toBe(false);
|
||||
});
|
||||
|
||||
it('restores the master toggle checked state from settings', () => {
|
||||
const manager = createManager();
|
||||
const masterToggle = document.createElement('input');
|
||||
masterToggle.type = 'checkbox';
|
||||
masterToggle.id = 'enableOtherModels';
|
||||
document.body.appendChild(masterToggle);
|
||||
|
||||
state.global.settings = { enable_other_models: true };
|
||||
manager.updateOtherModelsControls();
|
||||
expect(masterToggle.checked).toBe(true);
|
||||
|
||||
state.global.settings = { enable_other_models: false };
|
||||
manager.updateOtherModelsControls();
|
||||
expect(masterToggle.checked).toBe(false);
|
||||
});
|
||||
|
||||
it('persists the checked sub_types as the whole allow-list', async () => {
|
||||
const manager = createManager();
|
||||
appendToggles('vae', 'upscaler', 'controlnet');
|
||||
|
||||
Reference in New Issue
Block a user