diff --git a/plugins/scaffolder/src/components/TemplateEditorPage/DryRunResults/DryRunResultsList.tsx b/plugins/scaffolder/src/components/TemplateEditorPage/DryRunResults/DryRunResultsList.tsx index 384d48e871..0d9fcbc350 100644 --- a/plugins/scaffolder/src/components/TemplateEditorPage/DryRunResults/DryRunResultsList.tsx +++ b/plugins/scaffolder/src/components/TemplateEditorPage/DryRunResults/DryRunResultsList.tsx @@ -28,6 +28,7 @@ import DeleteIcon from '@material-ui/icons/Delete'; import DownloadIcon from '@material-ui/icons/GetApp'; import React from 'react'; import { DryRunResult, useDryRun } from '../DryRunContext'; +import { downloadBlob } from '../../../lib/download'; const useStyles = makeStyles((theme: BackstageTheme) => ({ root: { @@ -117,14 +118,3 @@ async function createZipDownload(directoryContents: { path: string; base64Conten throw new Error(err); }); } - - - -function downloadBlob(blob: Blob, name: string) { - const a = document.createElement('a'); - a.href = URL.createObjectURL(blob); - a.download = name; - a.click(); - URL.revokeObjectURL(a.href); - a.remove(); -}