Skip to content

Commit 62a2c23

Browse files
committed
fix: error state
1 parent 7b7dfd7 commit 62a2c23

File tree

1 file changed

+8
-1
lines changed
  • infrastructure/eid-wallet/src/routes/(auth)/register

1 file changed

+8
-1
lines changed

infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
let showDrawer = $state(false);
1111
let isBiometricScreen = $state(false);
1212
let isBiometricsAdded = $state(false);
13+
let isError = $state(false);
1314
1415
const handleFirstStep = async() => {
1516
if(pin.length === 4) firstStep = false;
@@ -42,6 +43,11 @@
4243
//handle logic when biometrics added successfully
4344
goto("/review");
4445
}
46+
47+
$effect(() => {
48+
if(repeatPin && repeatPin.length === 4 && pin !== repeatPin) isError = true;
49+
else isError = false;
50+
})
4551
</script>
4652

4753
{#if firstStep}
@@ -58,7 +64,8 @@
5864
<section>
5965
<h1 class="text-3xl text-black font-semibold mb-[1vh]">Re-enter your pin</h1>
6066
<p class="text-base text-black-700 font-normal mb-[14vh]">Confirm by entering pin again</p>
61-
<InputPin bind:pin={repeatPin}/>
67+
<InputPin bind:pin={repeatPin} {isError}/>
68+
<p class={`text-base font-normal text-red-900 mt-[3.4vh] ${isError ? "block" : "hidden"}`}>Your PIN does not match, try again.</p>
6269
</section>
6370
<ButtonAction class="w-full" callback={handleConfirm}>Confirm</ButtonAction>
6471
</main>

0 commit comments

Comments
 (0)