From 3845ccd08b45b03b956f42a537491b0df87b8522 Mon Sep 17 00:00:00 2001 From: Alex ORLUC <alex.orluc@maarch.org> Date: Fri, 10 May 2019 17:28:29 +0200 Subject: [PATCH] remove useless code --- .../print-separator.component.ts | 61 ++++++++----------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/src/frontend/app/separator/print-separator/print-separator.component.ts b/src/frontend/app/separator/print-separator/print-separator.component.ts index 531176163dc..c475b85cc3c 100644 --- a/src/frontend/app/separator/print-separator/print-separator.component.ts +++ b/src/frontend/app/separator/print-separator/print-separator.component.ts @@ -142,40 +142,33 @@ export class PrintSeparatorComponent implements OnInit { } downloadSeparators() { - - const url = this.docUrl; - this.http.get(url, { - responseType: 'blob' - }).subscribe( - (response) => { - const a = document.createElement('a'); - document.body.appendChild(a); - a.style.display = 'none'; - - const url = `data:application/pdf;base64,${this.docData}`; - a.href = url; - - let today: any; - let dd: any; - let mm: any; - let yyyy: any; - - today = new Date(); - dd = today.getDate(); - mm = today.getMonth() + 1; - yyyy = today.getFullYear(); - - if (dd < 10) { - dd = '0' + dd; - } - if (mm < 10) { - mm = '0' + mm; - } - today = dd + '-' + mm + '-' + yyyy; + const a = document.createElement('a'); + document.body.appendChild(a); + a.style.display = 'none'; + + const url = `data:application/pdf;base64,${this.docData}`; + a.href = url; + + let today: any; + let dd: any; + let mm: any; + let yyyy: any; + + today = new Date(); + dd = today.getDate(); + mm = today.getMonth() + 1; + yyyy = today.getFullYear(); + + if (dd < 10) { + dd = '0' + dd; + } + if (mm < 10) { + mm = '0' + mm; + } + today = dd + '-' + mm + '-' + yyyy; - a.download = this.lang.separators + "_" + today + ".pdf"; - a.click(); - window.URL.revokeObjectURL(url); - }); + a.download = this.lang.separators + "_" + today + ".pdf"; + a.click(); + window.URL.revokeObjectURL(url); } } -- GitLab