[backport rh-test] refactor: centralize all download utils across app and apply special cloud-specific behavior (#6230)

Backport of #6188 to `rh-test`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6230-backport-rh-test-refactor-centralize-all-download-utils-across-app-and-apply-special-c-2956d73d3650810d980fc30dfea02cc5)
by [Unito](https://www.unito.io)

Co-authored-by: Christian Byrne <cbyrne@comfy.org>
This commit is contained in:
Comfy Org PR Bot
2025-10-24 04:23:36 +09:00
committed by GitHub
parent 797b1c5bae
commit 63c91a62fd
9 changed files with 160 additions and 89 deletions

View File

@@ -51,20 +51,8 @@ export async function addStylesheet(
})
}
export function downloadBlob(filename: string, blob: Blob) {
const url = URL.createObjectURL(blob)
const a = $el('a', {
href: url,
download: filename,
style: { display: 'none' },
parent: document.body
})
a.click()
setTimeout(function () {
a.remove()
window.URL.revokeObjectURL(url)
}, 0)
}
/** @knipIgnoreUnusedButUsedByCustomNodes */
export { downloadBlob } from '@/base/common/downloadUtil'
export function uploadFile(accept: string) {
return new Promise<File>((resolve, reject) => {