Skip to content

Commit 2c9044d

Browse files
committed
Simplified a bit of TypeScript code.
1 parent 82b60dd commit 2c9044d

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

typescript-javascript/qrcodegen-input-demo.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,9 @@ namespace app {
4545
// Show/hide rows based on bitmap/vector image output
4646
const bitmapOutput: boolean = getInput("output-format-bitmap").checked;
4747
const scaleRow : HTMLElement = getElem("scale-row");
48-
let download = getElem("download") as HTMLAnchorElement;
4948
scaleRow.hidden = !bitmapOutput;
50-
if (bitmapOutput) {
51-
download.download = "qr-code.png";
52-
} else {
53-
download.download = "qr-code.svg";
54-
}
49+
let download = getElem("download") as HTMLAnchorElement;
50+
download.download = "qr-code." + (bitmapOutput ? "png" : "svg");
5551
download.removeAttribute("href");
5652

5753
// Reset output images in case of early termination

0 commit comments

Comments
 (0)