mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-15 16:33:02 -03:00
refactor: update cancelDownload method to conditionally delete file based on parameter
This commit is contained in:
@@ -259,7 +259,7 @@ export class JsHttpDownloader {
|
||||
}
|
||||
}
|
||||
|
||||
cancelDownload(): void {
|
||||
cancelDownload(deleteFile = true): void {
|
||||
if (this.abortController) {
|
||||
logger.log("[JsHttpDownloader] Cancelling download");
|
||||
this.abortController.abort();
|
||||
@@ -267,7 +267,7 @@ export class JsHttpDownloader {
|
||||
|
||||
this.cleanup();
|
||||
|
||||
if (this.currentOptions) {
|
||||
if (deleteFile && this.currentOptions && this.status !== "complete") {
|
||||
const filePath = path.join(this.currentOptions.savePath, this.folderName);
|
||||
if (fs.existsSync(filePath)) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user