From a2d3b34ea2268f4af3237f291c0bea21b44dfaea Mon Sep 17 00:00:00 2001 From: EETagent Date: Thu, 12 Jan 2023 21:13:04 +0100 Subject: [PATCH] feat: formatting & error for mobile code input --- .../login/[code=application]/+page.svelte | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/frontend/src/routes/(candidate)/auth/login/[code=application]/+page.svelte b/frontend/src/routes/(candidate)/auth/login/[code=application]/+page.svelte index cc06634..128517e 100644 --- a/frontend/src/routes/(candidate)/auth/login/[code=application]/+page.svelte +++ b/frontend/src/routes/(candidate)/auth/login/[code=application]/+page.svelte @@ -6,7 +6,7 @@ import { page } from '$app/stores'; import { goto } from '$app/navigation'; import { apiLogin } from '$lib/@api/candidate'; - import { SvelteToast, toast } from '@zerodevx/svelte-toast' + import { SvelteToast, toast } from '@zerodevx/svelte-toast'; let applicationId = Number($page.params.code); let codeValueMobile: string = ''; @@ -36,7 +36,7 @@ } } codeValueMobile = codeValueArray.join(''); - + if (codeValueArray.filter((item) => item !== '').length === 12) { await submit(); } else { @@ -44,7 +44,6 @@ } }; - const submit = async () => { console.log('submitting: ', codeValueArray); try { @@ -57,8 +56,8 @@ '--toastColor': 'mintcream', '--toastBackground': '#b91c1c', '--toastBarBackground': '#7f1d1d' - } - }) + } + }); isError = true; } }; @@ -94,9 +93,14 @@