Skip to content

Commit

Permalink
Handle single images
Browse files Browse the repository at this point in the history
  • Loading branch information
alexd-bes committed Sep 18, 2024
1 parent caff163 commit 1181ce4
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ export const useDownloadImages = (
},
{
onSuccess: async fetchedImages => {
if (fetchedImages.length === 1) {
const { blob } = fetchedImages[0];
const { type } = blob;
const fileExtension = type.split('/')[1];
download(
blob,
`${projectCode}_${entityCode}_${dashboardCode}_${reportCode}.${fileExtension}`,
);
return;
}

const blobsWithNames: {
blob: Blob;
name: string;
Expand Down

0 comments on commit 1181ce4

Please sign in to comment.