Skip to content

Commit

Permalink
fix: useImageDownloader hook
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam-bit committed Dec 11, 2023
1 parent 60a64af commit 588c849
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useImageDownloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface DownloadImagesProps {
images: string | string[];
}
const downloadSingleImage = (url: string) => {
const fileName = url.substring(url.lastIndexOf('/') + 1);
const fileName = 'unwrapped-image.png';
fetch(url)
.then((response) => response.blob())
.then((blob) => saveAs(blob, fileName))
Expand All @@ -16,7 +16,7 @@ const downloadSingleImage = (url: string) => {
const downloadMultipleImages = (urls: string[]) => {
const zip = new JSZip();
const promises = urls.map((url, index) => {
const fileName = `image${index + 1}.jpg`;
const fileName = `image${index + 1}.png`;

return fetch(url)
.then((response) => response.blob())
Expand Down

0 comments on commit 588c849

Please sign in to comment.