Fix multi-file dropzone upload issue causing bucket listing duplication (#5392)

This commit fixes the order of the functions inside the selectPrefix
function due to the fact that, as multiple files were being uploaded,
the resetObjects function (that clears the object list) ran repeatedly
for each of these objects, right before the appendObjects function (that
appends the objects being uploaded to the current list of objects) also
ran for all of these objects. This caused all the objects in the bucket
to be repeated in the list for the number of objects that were dragged
into the dropzone.
master
Kaan Kabalak 7 years ago committed by Nitish Tiwari
parent 12f67d47f1
commit 78a641fc6a
  1. 2
      browser/app/js/actions.js
  2. 46
      browser/ui-assets.go

@ -400,7 +400,6 @@ export const listObjects = () => {
export const selectPrefix = prefix => { export const selectPrefix = prefix => {
return (dispatch, getState) => { return (dispatch, getState) => {
const {currentBucket, web} = getState() const {currentBucket, web} = getState()
dispatch(resetObjects())
dispatch(setLoadPath(prefix)) dispatch(setLoadPath(prefix))
web.ListObjects({ web.ListObjects({
bucketName: currentBucket, bucketName: currentBucket,
@ -415,6 +414,7 @@ export const selectPrefix = prefix => {
object.name = object.name.replace(`${prefix}`, ''); object.name = object.name.replace(`${prefix}`, '');
return object return object
}) })
dispatch(resetObjects())
dispatch(appendObjects( dispatch(appendObjects(
objects, objects,
res.nextmarker, res.nextmarker,

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save