From 011b11d8d767da3355555fe1253b162f55e985c5 Mon Sep 17 00:00:00 2001 From: bymyself Date: Thu, 18 Jul 2024 18:59:18 -0700 Subject: [PATCH] LoadAudio restores file value from workflow (#4043) * LoadAudio restores file value from workflow * use onAfterGraphConfigured * Don't use anonnymous function --- web/extensions/core/uploadAudio.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/extensions/core/uploadAudio.js b/web/extensions/core/uploadAudio.js index 6cc3863a..9dfa029b 100644 --- a/web/extensions/core/uploadAudio.js +++ b/web/extensions/core/uploadAudio.js @@ -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/*"