Skip to content

Commit

Permalink
Fix download
Browse files Browse the repository at this point in the history
  • Loading branch information
hieyou1 committed Jun 28, 2024
1 parent dae8286 commit ba93299
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ const getFile: () => Promise<Blob> = async () => {
return file;
};
const download = async () => {
let type = getType();
let file = await getFile();
let url = URL.createObjectURL(file);

let a = document.createElement("a");
a.href = url;
a.download = "qr." + ((type == "jpeg") ? "jpg" : type);
a.click();

URL.revokeObjectURL(url);
Expand Down

0 comments on commit ba93299

Please sign in to comment.