fix: silence abort warning on cancel

This commit is contained in:
2026-06-07 19:37:20 +02:00
parent 8218583ffa
commit c21a67d4fb

View File

@@ -857,7 +857,7 @@ function htmlPage(): string {
for (const entry of listing) {
if (controller.signal.aborted) {
throw new DOMException("Import abgebrochen", "AbortError");
throw controller.signal.reason ?? new Error("Import abgebrochen");
}
try {
@@ -901,7 +901,7 @@ function htmlPage(): string {
);
setProgress(listing.length, listing.length, "fertig");
} catch (error) {
if (error instanceof DOMException && error.name === "AbortError") {
if (controller.signal.aborted) {
updateStatus("Import abgebrochen.");
setProgress(state.processed, state.total, "abgebrochen");
return;
@@ -940,7 +940,7 @@ function htmlPage(): string {
cancelShare.addEventListener("click", () => {
if (activeImportController) {
activeImportController.abort();
activeImportController.abort("Import durch Benutzer abgebrochen");
}
});