refactor: no img no download
This commit is contained in:
parent
78c0af9aae
commit
444371fc74
1 changed files with 2 additions and 1 deletions
|
|
@ -67,7 +67,8 @@ async function downloadImage(url: string) {
|
|||
let extension = '';
|
||||
|
||||
if (blob.type === 'image/jpeg') extension = '.jpg';
|
||||
if (blob.type === 'image/png') extension = '.png';
|
||||
else if (blob.type === 'image/png') extension = '.png';
|
||||
else return;
|
||||
|
||||
let a = document.createElement('a');
|
||||
a.download = `download${extension}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue