From 984f92ebf434a04da038a5dd6dd7b6a6a5f79a5b Mon Sep 17 00:00:00 2001
From: David Libeau
Date: Mon, 6 Apr 2020 21:12:50 +0200
Subject: [PATCH] =?UTF-8?q?Demander=20avant=20de=20sauvegarder=20les=20don?=
=?UTF-8?q?n=C3=A9es=20en=20local?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
certificate.js | 8 ++++++--
index.html | 4 ++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/certificate.js b/certificate.js
index 796d5f4..98f1e4d 100644
--- a/certificate.js
+++ b/certificate.js
@@ -198,7 +198,9 @@ function getAndSaveReasons () {
const values = $$('input[name="field-reason"]:checked')
.map(x => x.value)
.join('-')
- localStorage.setItem('reasons', values)
+ if ($('#checkbox-sauvegarde:checked')) {
+ localStorage.setItem('reasons', values)
+ }
return values
}
@@ -224,7 +226,9 @@ const snackbar = $('#snackbar')
$('#form-profile').addEventListener('submit', async event => {
event.preventDefault()
- saveProfile()
+ if ($('#checkbox-sauvegarde:checked')) {
+ saveProfile()
+ }
const reasons = getAndSaveReasons()
const pdfBlob = await generatePdf(getProfile(), reasons)
downloadBlob(pdfBlob, 'attestation.pdf')
diff --git a/index.html b/index.html
index f882a7f..871bbc7 100644
--- a/index.html
+++ b/index.html
@@ -239,6 +239,10 @@ Choisissez un motif de sortie
+
+
+
+