mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 22:52:12 -03:00
refactor(lora-pool-widget): adopt DOM widget value persistence best practices
- Replace custom onSetValue with ComfyUI's built-in widget.callback - Remove widget.updateConfig, set widget.value directly - Add isRestoring flag to break callback → watch → refreshPreview loop - Update ComponentWidget types with callback and deprecate old methods Refs: docs/dom-widgets/value-persistence-best-practices.md
This commit is contained in:
@@ -90,9 +90,8 @@ function createLoraPoolWidget(node) {
|
||||
},
|
||||
setValue(v: LoraPoolConfig | LegacyLoraPoolConfig) {
|
||||
internalValue = v
|
||||
if (typeof widget.onSetValue === 'function') {
|
||||
widget.onSetValue(v)
|
||||
}
|
||||
// ComfyUI automatically calls widget.callback after setValue
|
||||
// No need for custom onSetValue mechanism
|
||||
},
|
||||
serialize: true,
|
||||
// Per dev guide: providing getMinHeight via options allows the system to
|
||||
@@ -103,10 +102,6 @@ function createLoraPoolWidget(node) {
|
||||
}
|
||||
)
|
||||
|
||||
widget.updateConfig = (v: LoraPoolConfig) => {
|
||||
internalValue = v
|
||||
}
|
||||
|
||||
const vueApp = createApp(LoraPoolWidget, {
|
||||
widget,
|
||||
node
|
||||
|
||||
Reference in New Issue
Block a user