Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jrtcppv committed Aug 2, 2024
1 parent 0b3fefa commit 471cbf7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 7 additions & 5 deletions ui/src/js/project-detail/media-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,11 @@ export class MediaSection extends TatorElement {
const filenames = new Set();
const re = /(?:\.([^.]+))?$/;
let url = `${getUrl("Medias")}&presigned=28800`;
const mediaPromise = fetchCredentials(url, {}, true)
.then((response) => response.json());
Promise.all([directoryPromise, mediaPromise])
.then(async ([dirHandle, medias]) => {
const mediaPromise = fetchCredentials(url, {}, true).then((response) =>
response.json()
);
Promise.all([directoryPromise, mediaPromise]).then(
async ([dirHandle, medias]) => {
const names = [];
const urls = [];
dialog._setTotalFiles(medias.length);
Expand Down Expand Up @@ -486,7 +487,8 @@ export class MediaSection extends TatorElement {
}
}
downloadFileList(dirHandle, names, urls, callback, abort);
});
}
);
}

_downloadAnnotations(evt) {
Expand Down
8 changes: 7 additions & 1 deletion ui/src/js/util/download-file-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ async function downloadFile(name, url, index, existing, dirHandle) {
return msg;
}

export async function downloadFileList(dirHandle, names, urls, callback, abort) {
export async function downloadFileList(
dirHandle,
names,
urls,
callback,
abort
) {
if (dirHandle) {
const existing = new Set();
for await (const entry of dirHandle.values()) {
Expand Down

0 comments on commit 471cbf7

Please sign in to comment.