浏览代码

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

tags/2.0.0-beta.2
crazywoola 1 个月前
父节点
当前提交
c2e67e93ef
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 3
    1
      web/app/components/rag-pipeline/hooks/use-DSL.ts
  2. 3
    1
      web/app/components/workflow-app/hooks/use-DSL.ts

+ 3
- 1
web/app/components/rag-pipeline/hooks/use-DSL.ts 查看文件

@@ -39,9 +39,11 @@ export const useDSL = () => {
})
const a = document.createElement('a')
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.click()
URL.revokeObjectURL(url)
}
catch {
notify({ type: 'error', message: t('app.exportFailed') })

+ 3
- 1
web/app/components/workflow-app/hooks/use-DSL.ts 查看文件

@@ -39,9 +39,11 @@ export const useDSL = () => {
})
const a = document.createElement('a')
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.click()
URL.revokeObjectURL(url)
}
catch {
notify({ type: 'error', message: t('app.exportFailed') })

正在加载...
取消
保存