diff --git a/src/components/DriveView/Media.jsx b/src/components/DriveView/Media.jsx index 77d5e949..5d7c22a2 100644 --- a/src/components/DriveView/Media.jsx +++ b/src/components/DriveView/Media.jsx @@ -334,8 +334,8 @@ class Media extends Component { })); const routeNoDongleId = currentRoute.fullname.split('|')[1]; - const fileName = `${dongleId}|${routeNoDongleId}--${getSegmentNumber(currentRoute)}/${type}`; + const uploading = {}; uploading[fileName] = { requested: true }; this.props.dispatch(updateFiles(uploading)); @@ -344,9 +344,10 @@ class Media extends Component { let url_promises = []; // request all possible file names - for (let fn of FILE_NAMES[type]){ - paths.push(`${routeNoDongleId}--${getSegmentNumber(currentRoute)}/${fn}`); - url_promises.push(fetchUploadUrls(dongleId, [paths[paths.length - 1]]).then(urls => urls[0])); + for (let fn of FILE_NAMES[type]) { + const path = `${routeNoDongleId}--${getSegmentNumber(currentRoute)}/${fn}`; + paths.push(path); + url_promises.push(fetchUploadUrls(dongleId, [path]).then(urls => urls[0])); } const urls = await Promise.all(url_promises);