Skip to content

Commit

Permalink
Merge pull request #1119 from PintoGideon/pacs-query-with-oxidicom
Browse files Browse the repository at this point in the history
Improve downloads
  • Loading branch information
PintoGideon authored Mar 18, 2024
2 parents c1afab3 + ed090fa commit 612cb63
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/FeedOutputBrowser/FileBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ const FileBrowser = (props: FileBrowserProps) => {
};

const makeDataSourcePrivate = async () => {
console.log("Make it private again");
// Implement logic to make the data source private again
await feed?.put({
//@ts-ignore
Expand Down Expand Up @@ -107,17 +106,17 @@ const FileBrowser = (props: FileBrowserProps) => {
link.download = fileName; // Set the download attribute to specify the filename
// Append the anchor element to the document body
// Listen for the load event on the anchor element
link.onload = async () => {
// Make the data source private again after the download is done
privateFeed && (await makeDataSourcePrivate());
};

document.body.appendChild(link);
// Programmatically trigger the download
link.click();
// Remove the anchor element from the document body after the download is initiated
document.body.removeChild(link);

setTimeout(async () => {
privateFeed && (await makeDataSourcePrivate());
}, 2000); // Adjust the delay time as needed

return item;
} catch (e) {
throw e;
Expand Down

0 comments on commit 612cb63

Please sign in to comment.