diff --git a/src/utils/handlersUtil.js b/src/utils/handlersUtil.js index d58200f4..89fc6bc1 100644 --- a/src/utils/handlersUtil.js +++ b/src/utils/handlersUtil.js @@ -11,7 +11,7 @@ const handlersUtil = { Copy File - ${formattedFileSize} @@ -73,14 +73,15 @@ const handlersUtil = { for (var i = startIndex; i < containerItems.length; i++) { const commitElem = containerItems[i].querySelector('div:nth-of-type(3)'); - const isValidFile = data[actualDataIndex].type === 'file' && data[actualDataIndex].size !== 0; + const fileMetadata = data[actualDataIndex]; + const isValidFile = fileMetadata.type === 'file' && fileMetadata.size !== 0; if (commitElem) { containerItems[i].querySelector('div:nth-of-type(2)').classList.remove('col-md-2', 'mr-3'); containerItems[i].querySelector('div:nth-of-type(2)').classList.add('col-md-1', 'mr-2'); - if (isValidFile || data[actualDataIndex].type === 'symlink') { - const formattedFileSize = commonUtil.getFileSizeAndUnit(data[actualDataIndex]); + if (isValidFile || fileMetadata.type === 'symlink') { + const formattedFileSize = commonUtil.getFileSizeAndUnit(fileMetadata); const html = ` @@ -88,8 +89,8 @@ const handlersUtil = { ${formattedFileSize} - +