mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
Refactor storage handling across application
- Introduced a new storageHelpers module to centralize localStorage interactions, improving code maintainability and readability. - Updated various components and managers to utilize the new storageHelpers functions for setting, getting, and removing items from localStorage. - Added migration logic to handle localStorage items during application initialization, ensuring compatibility with the new storage structure. - Enhanced logging during application initialization for better debugging.
This commit is contained in:
@@ -2,6 +2,7 @@ import { modalManager } from './ModalManager.js';
|
||||
import { showToast } from '../utils/uiHelpers.js';
|
||||
import { state } from '../state/index.js';
|
||||
import { resetAndReload } from '../api/loraApi.js';
|
||||
import { setStorageItem } from '../utils/storageHelpers.js';
|
||||
|
||||
export class SettingsManager {
|
||||
constructor() {
|
||||
@@ -75,7 +76,7 @@ export class SettingsManager {
|
||||
state.global.settings.show_only_sfw = showOnlySFW;
|
||||
|
||||
// Save settings to localStorage
|
||||
localStorage.setItem('settings', JSON.stringify(state.global.settings));
|
||||
setStorageItem('settings', state.global.settings);
|
||||
|
||||
try {
|
||||
// Save backend settings via API
|
||||
|
||||
Reference in New Issue
Block a user