From 20dd9b87cf0ad98ee26e32ed3a3efde6d0f0b97e Mon Sep 17 00:00:00 2001 From: vineethvk11 Date: Tue, 12 Mar 2024 23:48:15 +0530 Subject: [PATCH] adding ability to undo copy --- src/helpers.js | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/helpers.js b/src/helpers.js index 552382582..78aadcb89 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -1527,6 +1527,8 @@ window.copy_clipboard_items = async function(dest_path, dest_container_element){ progwin = await UIWindowCopyProgress({operation_id: copy_op_id}); }, 2000); + const copied_item_paths = [] + for(let i=0; i{ } else if(last_action.operation === 'upload') { const files = last_action.data; undo_upload(files); + } else if(last_action.operation === 'copy') { + const files = last_action.data; + undo_copy(files); } } } @@ -3490,7 +3516,12 @@ window.undo_create_file_or_folder = async(item)=>{ window.undo_upload = async(files)=>{ for (const file of files) { - console.log(file) await window.delete_item_with_path(file); } } + +window.undo_copy = async(files)=>{ + for (const file of files) { + await window.delete_item_with_path(file); + } +} \ No newline at end of file