Skip to content

Commit

Permalink
Applied requested changes
Browse files Browse the repository at this point in the history
Signed-off-by: Juergen Kellerer <[email protected]>
  • Loading branch information
jkellerer committed Oct 26, 2022
1 parent da7e5eb commit 8b4cab1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/store/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,13 @@ const actions = {
/**
* Append or update given files
*
* @param {object} context the store mutations
* @param {object.commit} commit the store mutation commit function
* @param {object.state} state the store state
* @param {Array} files list of files
* @return {Array} the appended files
*/
appendFiles(context, files = []) {
context.commit('updateFiles', files)
appendFiles({ commit, state }, files = []) {
commit('updateFiles', files)
return files.filter(file => !!state.files[file.fileid])
},

Expand All @@ -178,7 +179,7 @@ const actions = {
const semaphore = new Semaphore(5)

const files = fileIds
.map(fileId => state.files[fileId])
.map(fileId => context.state.files[fileId])
.reduce((files, file) => ({ ...files, [file.fileid]: file }), {})

fileIds.forEach(fileId => context.commit('deleteFile', fileId))
Expand Down

0 comments on commit 8b4cab1

Please sign in to comment.