mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-21 21:22:11 -03:00
feat: Enhance model preview version management with localStorage support
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Create the new hierarchical state structure
|
||||
import { getStorageItem } from '../utils/storageHelpers.js';
|
||||
import { getStorageItem, getMapFromStorage } from '../utils/storageHelpers.js';
|
||||
|
||||
// Load settings from localStorage or use defaults
|
||||
const savedSettings = getStorageItem('settings', {
|
||||
@@ -7,6 +7,10 @@ const savedSettings = getStorageItem('settings', {
|
||||
show_only_sfw: false
|
||||
});
|
||||
|
||||
// Load preview versions from localStorage
|
||||
const loraPreviewVersions = getMapFromStorage('lora_preview_versions');
|
||||
const checkpointPreviewVersions = getMapFromStorage('checkpoint_preview_versions');
|
||||
|
||||
export const state = {
|
||||
// Global state
|
||||
global: {
|
||||
@@ -23,7 +27,7 @@ export const state = {
|
||||
hasMore: true,
|
||||
sortBy: 'name',
|
||||
activeFolder: null,
|
||||
previewVersions: new Map(),
|
||||
previewVersions: loraPreviewVersions,
|
||||
searchManager: null,
|
||||
searchOptions: {
|
||||
filename: true,
|
||||
@@ -66,6 +70,7 @@ export const state = {
|
||||
hasMore: true,
|
||||
sortBy: 'name',
|
||||
activeFolder: null,
|
||||
previewVersions: checkpointPreviewVersions,
|
||||
searchManager: null,
|
||||
searchOptions: {
|
||||
filename: true,
|
||||
|
||||
Reference in New Issue
Block a user