LoadAudio restores file value from workflow (#4043)

* LoadAudio restores file value from workflow

* use onAfterGraphConfigured

* Don't use anonnymous function
This commit is contained in:
bymyself 2024-07-18 18:59:18 -07:00 committed by GitHub
parent ff6ca2a892
commit 011b11d8d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -149,6 +149,15 @@ app.registerExtension({
}
audioWidget.callback = onAudioWidgetUpdate
// Load saved audio file widget values if restoring from workflow
const onGraphConfigured = node.onGraphConfigured;
node.onGraphConfigured = function() {
onGraphConfigured?.apply(this, arguments)
if (audioWidget.value) {
onAudioWidgetUpdate()
}
}
const fileInput = document.createElement("input")
fileInput.type = "file"
fileInput.accept = "audio/*"