[backport 1.28] Use type check instead of cast (#6042)

Backport of #6041 to `core/1.28`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6042-backport-1-28-Use-type-check-instead-of-cast-28b6d73d365081c890abe16efbff7c2b)
by [Unito](https://www.unito.io)

Co-authored-by: AustinMroz <austin@comfy.org>
This commit is contained in:
Comfy Org PR Bot
2025-10-15 02:48:07 +09:00
committed by GitHub
parent 644ef01d22
commit 947ea62b00

View File

@@ -201,8 +201,9 @@ app.registerExtension({
) as unknown as DOMWidget<HTMLAudioElement, string>
const onAudioWidgetUpdate = () => {
if (typeof audioWidget.value !== 'string') return
audioUIWidget.element.src = api.apiURL(
getResourceURL(...splitFilePath(audioWidget.value as string))
getResourceURL(...splitFilePath(audioWidget.value))
)
}
// Initially load default audio file to audioUIWidget.