Skip to content

Commit

Permalink
fix(QFile): (backport from Qv2) files wrongly marked as duplicated wh…
Browse files Browse the repository at this point in the history
…en non-append after subsequent file picking #14406
  • Loading branch information
rstoenescu committed Sep 16, 2022
1 parent 24ffd09 commit 50cdb12
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ui/src/mixins/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@ export default {
file.__key = file.webkitRelativePath + file.lastModified + file.name + file.size
})

// Avoid duplicate files
const filenameMap = currentFileList.map(entry => entry.__key)
files = filterFiles(files, rejectedFiles, 'duplicate', file => {
return filenameMap.includes(file.__key) === false
})
if (append !== true) {
// Avoid duplicate files
const filenameMap = currentFileList.map(entry => entry.__key)
files = filterFiles(files, rejectedFiles, 'duplicate', file => {
return filenameMap.includes(file.__key) === false
})
}

if (files.length === 0) { return done() }

Expand Down

0 comments on commit 50cdb12

Please sign in to comment.