mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-15 16:33:02 -03:00
refactor: update cancel download confirmation text and enhance error handling in JsHttpDownloader
This commit is contained in:
@@ -404,9 +404,10 @@
|
||||
"completed": "Completed",
|
||||
"removed": "Not downloaded",
|
||||
"cancel": "Cancel",
|
||||
"cancel_download": "Cancel download",
|
||||
"cancel_download_description": "Are you sure you want to cancel this download? This will delete all downloaded files.",
|
||||
"keep_downloading": "Keep downloading",
|
||||
"cancel_download": "Cancel download?",
|
||||
"cancel_download_description": "Are you sure you want to cancel this download? All downloaded files will be deleted.",
|
||||
"keep_downloading": "No, keep downloading",
|
||||
"yes_cancel": "Yes, cancel",
|
||||
"filter": "Filter downloaded games",
|
||||
"remove": "Remove",
|
||||
"downloading_metadata": "Downloading metadata…",
|
||||
|
||||
@@ -258,7 +258,11 @@ export class JsHttpDownloader {
|
||||
}
|
||||
|
||||
private handleDownloadError(err: Error): void {
|
||||
if (err.name === "AbortError") {
|
||||
// Handle abort/cancellation errors - these are expected when user pauses/cancels
|
||||
if (
|
||||
err.name === "AbortError" ||
|
||||
(err as NodeJS.ErrnoException).code === "ERR_STREAM_PREMATURE_CLOSE"
|
||||
) {
|
||||
logger.log("[JsHttpDownloader] Download aborted");
|
||||
this.status = "paused";
|
||||
} else {
|
||||
|
||||
@@ -844,7 +844,7 @@ export function DownloadGroup({
|
||||
visible={cancelModalVisible}
|
||||
title={t("cancel_download")}
|
||||
descriptionText={t("cancel_download_description")}
|
||||
confirmButtonLabel={t("cancel")}
|
||||
confirmButtonLabel={t("yes_cancel")}
|
||||
cancelButtonLabel={t("keep_downloading")}
|
||||
onConfirm={handleConfirmCancel}
|
||||
onClose={handleCancelModalClose}
|
||||
@@ -877,7 +877,7 @@ export function DownloadGroup({
|
||||
visible={cancelModalVisible}
|
||||
title={t("cancel_download")}
|
||||
descriptionText={t("cancel_download_description")}
|
||||
confirmButtonLabel={t("cancel")}
|
||||
confirmButtonLabel={t("yes_cancel")}
|
||||
cancelButtonLabel={t("keep_downloading")}
|
||||
onConfirm={handleConfirmCancel}
|
||||
onClose={handleCancelModalClose}
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: globals.$spacing-unit;
|
||||
padding-bottom: calc(globals.$spacing-unit * 3);
|
||||
}
|
||||
|
||||
&__empty {
|
||||
@@ -134,5 +135,6 @@
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: calc(globals.$spacing-unit * 2);
|
||||
padding-bottom: calc(globals.$spacing-unit * 3);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user