feat: load legary reports

This commit is contained in:
Ilia Denisov
2026-05-10 12:16:08 +02:00
parent f5ac9fac59
commit 132ed4e0db
2 changed files with 6213 additions and 2 deletions
+8 -2
View File
@@ -194,8 +194,14 @@
async function onSyntheticFileChange(
event: Event & { currentTarget: HTMLInputElement },
): Promise<void> {
// Capture the element synchronously: `event.currentTarget`
// is nulled by the time any of the awaits below resolve, and
// reaching for it from the `finally` block then throws
// "null is not an object". The reset still has to happen so
// re-selecting the same file fires `change` again.
const input = event.currentTarget;
syntheticError = null;
const file = event.currentTarget.files?.[0];
const file = input.files?.[0];
if (file === undefined) return;
try {
const text = await file.text();
@@ -213,7 +219,7 @@
syntheticError = "failed to load synthetic report";
}
} finally {
event.currentTarget.value = "";
input.value = "";
}
}