Browse Source

Fix mem leak of URL.createObjectURL() (#25303)

tags/2.0.0-beta.2
crazywoola 1 month ago
parent
commit
c2e67e93ef
No account linked to committer's email address

+ 3
- 1
web/app/components/rag-pipeline/hooks/use-DSL.ts View File

}) })
const a = document.createElement('a') const a = document.createElement('a')
const file = new Blob([data], { type: 'application/yaml' }) const file = new Blob([data], { type: 'application/yaml' })
a.href = URL.createObjectURL(file)
const url = URL.createObjectURL(file)
a.href = url
a.download = `${knowledgeName}.pipeline` a.download = `${knowledgeName}.pipeline`
a.click() a.click()
URL.revokeObjectURL(url)
} }
catch { catch {
notify({ type: 'error', message: t('app.exportFailed') }) notify({ type: 'error', message: t('app.exportFailed') })

+ 3
- 1
web/app/components/workflow-app/hooks/use-DSL.ts View File

}) })
const a = document.createElement('a') const a = document.createElement('a')
const file = new Blob([data], { type: 'application/yaml' }) const file = new Blob([data], { type: 'application/yaml' })
a.href = URL.createObjectURL(file)
const url = URL.createObjectURL(file)
a.href = url
a.download = `${appDetail.name}.yml` a.download = `${appDetail.name}.yml`
a.click() a.click()
URL.revokeObjectURL(url)
} }
catch { catch {
notify({ type: 'error', message: t('app.exportFailed') }) notify({ type: 'error', message: t('app.exportFailed') })

Loading…
Cancel
Save