fix: URL revoke race in exportSave

URL.revokeObjectURL() was called synchronously after a.click(), but
some browsers need the blob URL alive during download initiation.
Now delayed 1s via setTimeout to let the download start safely.
Fixes #63
This commit is contained in:
Alexander Whitestone
2026-04-12 11:54:32 -04:00
parent e85eddb00a
commit eb2579f1fa

View File

@@ -2842,7 +2842,8 @@ function exportSave() {
const ts = new Date().toISOString().slice(0, 10);
a.download = `beacon-save-${ts}.json`;
a.click();
URL.revokeObjectURL(url);
// Delay revoke to avoid race — some browsers need time to start the download
setTimeout(() => URL.revokeObjectURL(url), 1000);
log('Save exported to file.');
}