diff --git a/src/globals.js b/src/globals.js index 1a0e4c18..f5a53301 100644 --- a/src/globals.js +++ b/src/globals.js @@ -91,7 +91,7 @@ window.default_taskbar_height = 50; window.taskbar_height = window.default_taskbar_height; window.upload_progress_hide_delay = 500; window.active_uploads = {}; -window.copy_progress_hide_delay = 1000; +window.copy_progress_hide_delay = 2000; window.busy_indicator_hide_delay = 600; window.global_element_id = 0; window.operation_id = 0; diff --git a/src/helpers.js b/src/helpers.js index d2a40fce..6836dd9a 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -1476,7 +1476,13 @@ window.copy_clipboard_items = async function(dest_path, dest_container_element){ let overwrite_all = false; (async()=>{ let copy_progress_window_init_ts = Date.now(); - let progwin = await UIWindowCopyProgress({operation_id: copy_op_id}); + + // only show progress window if it takes longer than 2s to copy + let progwin; + let progwin_timeout = setTimeout(async () => { + progwin = await UIWindowCopyProgress({operation_id: copy_op_id}); + }, 2000); + for(let i=0; i= copy_progress_hide_delay){ + if(progwin && copy_duration >= copy_progress_hide_delay){ $(progwin).close(); - }else{ + }else if(progwin){ setTimeout(() => { setTimeout(() => { $(progwin).close(); @@ -1555,7 +1563,13 @@ window.copy_items = function(el_items, dest_path){ let overwrite_all = false; (async()=>{ let copy_progress_window_init_ts = Date.now(); - let progwin = await UIWindowCopyProgress({operation_id: copy_op_id}); + + // only show progress window if it takes longer than 2s to copy + let progwin; + let progwin_timeout = setTimeout(async () => { + progwin = await UIWindowCopyProgress({operation_id: copy_op_id}); + }, 2000); + for(let i=0; i < el_items.length; i++){ let copy_path = $(el_items[i]).attr('data-path'); let item_with_same_name_already_exists = true; @@ -1612,10 +1626,12 @@ window.copy_items = function(el_items, dest_path){ } // done + clearTimeout(progwin_timeout); + let copy_duration = (Date.now() - copy_progress_window_init_ts); - if( copy_duration >= copy_progress_hide_delay){ + if(progwin && copy_duration >= copy_progress_hide_delay){ $(progwin).close(); - }else{ + }else if(progwin){ setTimeout(() => { setTimeout(() => { $(progwin).close(); @@ -2250,8 +2266,11 @@ window.move_items = async function(el_items, dest_path){ // when did this operation start let move_init_ts = Date.now(); - // create progress window - let progwin = await UIWindowMoveProgress({operation_id: move_op_id}); + // only show progress window if it takes longer than 2s to move + let progwin; + let progwin_timeout = setTimeout(async () => { + progwin = await UIWindowMoveProgress({operation_id: move_op_id}); + }, 2000); // Go through each item and try to move it for(let i=0; i 1 ? 's':''} in ${move_duration}ms`); @@ -2604,9 +2625,11 @@ window.move_items = async function(el_items, dest_path){ // ----------------------------------------------------------------------- // DONE! close progress window with delay to allow user to see 100% progress // ----------------------------------------------------------------------- - setTimeout(() => { - $(progwin).close(); - }, copy_progress_hide_delay); + if(progwin){ + setTimeout(() => { + $(progwin).close(); + }, copy_progress_hide_delay); + } } /**