+1
-11
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user