refactor(web): consolidate download helpers (#31664)

This commit is contained in:
盐粒 Yanli
2026-01-29 16:02:49 +08:00
committed by GitHub
parent 74cfe77674
commit b9ac7af9c5
26 changed files with 167 additions and 270 deletions

View File

@ -249,15 +249,3 @@ export const fileIsUploaded = (file: FileEntity) => {
if (file.transferMethod === TransferMethod.remote_url && file.progress === 100)
return true
}
export const downloadFile = (url: string, filename: string) => {
const anchor = document.createElement('a')
anchor.href = url
anchor.download = filename
anchor.style.display = 'none'
anchor.target = '_blank'
anchor.title = filename
document.body.appendChild(anchor)
anchor.click()
document.body.removeChild(anchor)
}