Feat: Loading state while loading dropped workflows (#6464)

## Summary

Indicate to the user that we're hard at work parsing their JSON behind
the scenes.

## Changes

- **What**: Turn on the loading spinner while processing a workflow
- **What else**: Refactored the code around figuring out how to grab the
data from the file to make this easier

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6464-WIP-Loading-state-for-dropped-workflows-29c6d73d3650812dba66f2a7d27a777c)
by [Unito](https://www.unito.io)

---------

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Alexander Brown
2025-11-01 22:50:29 -07:00
committed by GitHub
parent 0e9c29e7b7
commit 31e405abc8
8 changed files with 287 additions and 263 deletions

View File

@@ -393,9 +393,11 @@ export class ComfyUI {
style: { display: 'none' },
parent: document.body,
onchange: async () => {
// @ts-expect-error fixme ts strict error
await app.handleFile(fileInput.files[0], 'file_button')
fileInput.value = ''
const file = fileInput.files?.[0]
if (file) {
await app.handleFile(file, 'file_button')
fileInput.value = ''
}
}
})