Skip to content

Commit ef466d7

Browse files
authored
Merge pull request #34 from govtechmy/feature/SSD-627-update-download-url
SSD-627: Update download - remove unused codes
2 parents 811e9ea + 486f34e commit ef466d7

File tree

2 files changed

+1
-144
lines changed

2 files changed

+1
-144
lines changed

lib/downloads.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,5 @@ export const generateDownloadLink = (
3232
ext: "pdf" | "csv"
3333
): void => {
3434
const path = buildDownloadPath(filename, ext);
35-
try {
36-
const anchor = document.createElement("a");
37-
anchor.href = path;
38-
anchor.target = "_blank";
39-
document.body.appendChild(anchor);
40-
anchor.click();
41-
document.body.removeChild(anchor);
42-
} catch (_err) {
43-
// Swallow errors silently; caller may choose to add its own handling.
44-
}
35+
window.open(path, "_blank");
4536
};

pages/downloads/[...key].tsx

Lines changed: 0 additions & 134 deletions
This file was deleted.

0 commit comments

Comments
 (0)