Skip to content

Commit

Permalink
fix: Handle multiple file downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
PintoGideon committed Feb 11, 2025
1 parent 0437fdf commit 8523386
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/store/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ export const downloadFile = async (file: FileBrowserFolderFile) => {
} else {
// Otherwise, create a token
const client = ChrisAPIClient.getClient();
await new Promise((resolve) => setTimeout(resolve, 200)); // 200ms delay
const response = await client.createDownloadToken();
if (!response) {
throw new Error("Failed to fetch the token...");
}
const token = response.data.token;

authorizedUrl = `${baseUrl}?download_token=${token}`;
}

Expand Down

0 comments on commit 8523386

Please sign in to comment.