mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-21 15:24:09 +00:00
Remove migration logic (settings & templates storage location) (#1732)
* Remove isNewUserSession handling * Remove writing of setting and templates to localStorage
This commit is contained in:
@@ -89,9 +89,6 @@ export class ComfySettingsDialog extends ComfyDialog<HTMLDialogElement> {
|
||||
) {
|
||||
value = this.tryMigrateDeprecatedValue(id, value)
|
||||
|
||||
const json = JSON.stringify(value)
|
||||
localStorage['Comfy.Settings.' + id] = json // backwards compatibility for extensions keep setting in storage
|
||||
|
||||
let oldValue = this.getSettingValue(id, undefined)
|
||||
this.settingsValues[id] = value
|
||||
|
||||
@@ -142,20 +139,7 @@ export class ComfySettingsDialog extends ComfyDialog<HTMLDialogElement> {
|
||||
throw new Error(`Setting ${id} of type ${type} must have a unique ID.`)
|
||||
}
|
||||
|
||||
let value = this.getSettingValue(id)
|
||||
if (value == null) {
|
||||
if (this.app.isNewUserSession) {
|
||||
// Check if we have a localStorage value but not a setting value and we are a new user
|
||||
const localValue = localStorage['Comfy.Settings.' + id]
|
||||
if (localValue) {
|
||||
value = JSON.parse(localValue)
|
||||
this.setSettingValue(id, value) // Store on the server
|
||||
}
|
||||
}
|
||||
if (value == null) {
|
||||
value = defaultValue
|
||||
}
|
||||
}
|
||||
const value = this.getSettingValue(id) ?? defaultValue
|
||||
|
||||
// Trigger initial setting of value
|
||||
onChange?.(value, undefined)
|
||||
|
||||
Reference in New Issue
Block a user