From af08da55d47fbdc23f3720c001ef752d8536e706 Mon Sep 17 00:00:00 2001 From: Sebastian Pravda Date: Sun, 5 Feb 2023 16:03:14 +0100 Subject: [PATCH] fix: push autofill message only on page 4 --- .../(authenticated)/register/+page.svelte | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte index ac8d428..407d70b 100644 --- a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte +++ b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte @@ -420,24 +420,13 @@ let [birthdate, sex] = parseBirthdateSexFromPersonalId(data.whoami.personalIdNumber); $form.candidate.birthdate = birthdate; $form.candidate.sex = sex; - pushSuccessText( - `Datum narození a pohlaví bylo vyplněno automaticky podle Vašeho rodného čísla (${data.whoami.personalIdNumber}).` - ); + if (pageIndex === 4) { + pushSuccessText( + `Datum narození a pohlaví bylo vyplněno automaticky podle Vašeho rodného čísla (${data.whoami.personalIdNumber}).` + ); + } } } - /* $: if ($form.candidate.citizenship === 'Česká republika') { - if ($form.candidate.birthdate === '' && $form.candidate.sex === '') { - let [birthdate, sex] = parseBirthdateSexFromPersonalId(data.whoami.personalIdNumber); - $form.candidate.birthdate = birthdate; - $form.candidate.sex = sex; - pushSuccessText( - `Datum narození a pohlaví bylo vyplněno automaticky podle Vašeho rodného čísla (${data.whoami.personalIdNumber}).` - ); - } - } else { - $form.candidate.birthdate = ''; - $form.candidate.sex = ''; - } */ if (details !== undefined) { details.candidate.birthdate = details.candidate.birthdate.split('-').reverse().join('.');