From a3c9d06e14d2ace05e9b0fece1b820479b096497 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Tue, 14 Apr 2020 19:14:17 +0200 Subject: [PATCH] Made download cancelling process more clear --- public/js/downloadList.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/public/js/downloadList.js b/public/js/downloadList.js index 513c91a..cebe7b8 100644 --- a/public/js/downloadList.js +++ b/public/js/downloadList.js @@ -110,11 +110,22 @@ socket.on("finishDownload", function(uuid){ } }) -socket.on("removedAllDownloads", function(){ - queue = [] - queueList = {} +socket.on("removedAllDownloads", function(currentItem){ queueComplete = [] - $("#download_list").html("") + if (currentItem == ""){ + queue = [] + queueList = {} + $("#download_list").html("") + }else{ + queue = [currentItem, ] + tempQueueItem = queueList[currentItem] + queueList = {} + queueList[currentItem] = tempQueueItem + $(".download_object").each(function(index){ + if ($(this).attr('id') != "download_"+currentItem) + $(this).remove() + }) + } }) socket.on("removedFinishedDownloads", function(){