Remove migration logic (settings & templates storage location) (#1732)

* Remove isNewUserSession handling

* Remove writing of setting and templates to localStorage
This commit is contained in:
Chenlei Hu
2024-11-28 11:24:06 -08:00
committed by GitHub
parent b0085114d7
commit df3fff5dbb
4 changed files with 21 additions and 55 deletions

View File

@@ -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)