Add defensive checks before removeChild to prevent 'Failed to execute removeChild' error when the element has already been removed from DOM. Wrap URL.revokeObjectURL in finally block to ensure proper resource cleanup.
This commit is contained in:
parent
4395392558
commit
452ecd77b9
|
|
@ -87,8 +87,13 @@ export function ResearchBlock({
|
|||
document.body.appendChild(a);
|
||||
a.click();
|
||||
setTimeout(() => {
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
try {
|
||||
if (a.parentNode) {
|
||||
a.parentNode.removeChild(a);
|
||||
}
|
||||
} finally {
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
}, 0);
|
||||
}, [reportId]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue