fix: silence abort warning on cancel
This commit is contained in:
@@ -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");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user