Skip to content

Commit

Permalink
small clean ups
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Jul 25, 2024
1 parent 5e4034a commit c54b789
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/DriveView/Media.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down

0 comments on commit c54b789

Please sign in to comment.