feat: fix download ss logic
This commit is contained in:
@@ -510,9 +510,22 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe
|
|||||||
<AccordionDetails>
|
<AccordionDetails>
|
||||||
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 2 }}>
|
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 2 }}>
|
||||||
<Button
|
<Button
|
||||||
component="a"
|
onClick={() => {
|
||||||
href={row.binaryOutput[screenshotKeys[currentScreenshotIndex]]}
|
fetch(row.binaryOutput[screenshotKeys[currentScreenshotIndex]])
|
||||||
download={screenshotKeys[currentScreenshotIndex]}
|
.then(response => response.blob())
|
||||||
|
.then(blob => {
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.style.display = 'none';
|
||||||
|
a.href = url;
|
||||||
|
a.download = screenshotKeys[currentScreenshotIndex];
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
document.body.removeChild(a);
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
})
|
||||||
|
.catch(err => console.error('Download failed:', err));
|
||||||
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
color: '#FF00C3',
|
color: '#FF00C3',
|
||||||
textTransform: 'none',
|
textTransform: 'none',
|
||||||
|
|||||||
Reference in New Issue
Block a user