From 3177d9944062170293e691a7f139cfb8bb2bcccd Mon Sep 17 00:00:00 2001 From: gourav Date: Thu, 13 Nov 2025 15:26:14 +0530 Subject: [PATCH 1/9] fix: app-issueS --- .../src/routes/(auth)/register/+page.svelte | 170 +++++++++--------- 1 file changed, 90 insertions(+), 80 deletions(-) diff --git a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte index f72e06026..9745813b1 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte @@ -1,88 +1,98 @@ {#if firstStep} From 0145b00a653711fbc8bfa35cc4a370ae56e8a02b Mon Sep 17 00:00:00 2001 From: gourav Date: Thu, 13 Nov 2025 15:44:56 +0530 Subject: [PATCH 2/9] fix: repeat pin button validation --- .../src/routes/(auth)/register/+page.svelte | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte index 9745813b1..624922808 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte @@ -16,11 +16,14 @@ let isBiometricScreen = $state(false); let isBiometricsAdded = $state(false); let isError = $state(false); + let btnVariant = $state<"soft" | "solid">("soft"); let globalState: GlobalState | undefined = $state(undefined); const handleFirstStep = async () => { - if (pin.length === 4) firstStep = false; + if (pin.length === 4) { + (firstStep = false), (btnVariant = "solid"); + } }; let handleConfirm: () => Promise = $state(async () => {}); @@ -55,11 +58,6 @@ console.log("isBiometricsAvailable", isBiometricsAvailable); handleConfirm = async () => { - if (pin.length < 4) { - isError = true; - return; - } - if (repeatPin.length < 4) { isError = true; return; @@ -129,7 +127,7 @@ - Confirm From 21b019df7a42bd2217b651b2da09bc0bfcfaa0f9 Mon Sep 17 00:00:00 2001 From: gourav Date: Thu, 13 Nov 2025 16:10:24 +0530 Subject: [PATCH 3/9] fix: input pin component --- infrastructure/control-panel/package.json | 2 +- .../src/lib/ui/InputPin/InputPin.svelte | 219 +++++++------- .../src/routes/(auth)/login/+page.svelte | 268 +++++++++--------- .../src/routes/(auth)/register/+page.svelte | 175 ++++++------ 4 files changed, 342 insertions(+), 322 deletions(-) diff --git a/infrastructure/control-panel/package.json b/infrastructure/control-panel/package.json index 9d4f59ff6..39e80d92f 100644 --- a/infrastructure/control-panel/package.json +++ b/infrastructure/control-panel/package.json @@ -54,4 +54,4 @@ "lucide-svelte": "^0.539.0", "tailwind-merge": "^3.0.2" } -} \ No newline at end of file +} diff --git a/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte b/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte index 378a32a07..e994ce0ea 100644 --- a/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte +++ b/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte @@ -1,118 +1,125 @@
diff --git a/infrastructure/eid-wallet/src/routes/(auth)/login/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/login/+page.svelte index 3f2477bf4..d6665ec96 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/login/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/login/+page.svelte @@ -1,144 +1,152 @@
- import { goto } from "$app/navigation"; - import { Hero } from "$lib/fragments"; - import type { GlobalState } from "$lib/global"; - import { ButtonAction, Drawer, InputPin } from "$lib/ui"; - import { CircleLock01Icon, FaceIdIcon } from "@hugeicons/core-free-icons"; - import { HugeiconsIcon } from "@hugeicons/svelte"; - import { checkStatus } from "@tauri-apps/plugin-biometric"; - import { getContext, onMount } from "svelte"; - - let pin = $state(""); - let repeatPin = $state(""); - let firstStep = $state(true); - let showDrawer = $state(false); - let isBiometricsAvailable = $state(false); - let isBiometricScreen = $state(false); - let isBiometricsAdded = $state(false); - let isError = $state(false); - let btnVariant = $state<"soft" | "solid">("soft"); - - let globalState: GlobalState | undefined = $state(undefined); - - const handleFirstStep = async () => { - if (pin.length === 4) { - (firstStep = false), (btnVariant = "solid"); +import { goto } from "$app/navigation"; +import { Hero } from "$lib/fragments"; +import type { GlobalState } from "$lib/global"; +import { ButtonAction, Drawer, InputPin } from "$lib/ui"; +import { CircleLock01Icon, FaceIdIcon } from "@hugeicons/core-free-icons"; +import { HugeiconsIcon } from "@hugeicons/svelte"; +import { checkStatus } from "@tauri-apps/plugin-biometric"; +import { getContext, onMount } from "svelte"; + +let pin = $state(""); +let repeatPin = $state(""); +let firstStep = $state(true); +let showDrawer = $state(false); +let isBiometricsAvailable = $state(false); +let isBiometricScreen = $state(false); +let isBiometricsAdded = $state(false); +let isError = $state(false); +let btnVariant = $state<"soft" | "solid">("soft"); + +let globalState: GlobalState | undefined = $state(undefined); + +const handleFirstStep = async () => { + if (pin.length === 4) { + (firstStep = false), (btnVariant = "solid"); + } +}; + +let handleConfirm: () => Promise = $state(async () => {}); + +const handleNext = async () => { + //handle next logic goes here + isBiometricScreen = true; +}; + +const handleSkip = async () => { + // handle skip biometics logic goes here + goto("/review"); +}; + +let handleSetupBiometrics = $state(async () => {}); + +const handleBiometricsAdded = async () => { + //handle logic when biometrics added successfully + goto("/review"); +}; + +$effect(() => { + if (repeatPin && repeatPin.length === 4 && pin === repeatPin) + isError = false; +}); + +onMount(async () => { + globalState = getContext<() => GlobalState>("globalState")(); + if (!globalState) throw new Error("Global state is not defined"); + + isBiometricsAvailable = (await checkStatus()).isAvailable; + console.log("isBiometricsAvailable", isBiometricsAvailable); + + handleConfirm = async () => { + if (repeatPin.length < 4) { + isError = true; + return; } - }; - - let handleConfirm: () => Promise = $state(async () => {}); - - const handleNext = async () => { - //handle next logic goes here - isBiometricScreen = true; - }; - - const handleSkip = async () => { - // handle skip biometics logic goes here - goto("/review"); - }; - let handleSetupBiometrics = $state(async () => {}); + if (pin !== repeatPin) { + isError = true; + firstStep = true; + return; + } - const handleBiometricsAdded = async () => { - //handle logic when biometrics added successfully - goto("/review"); + isError = false; + try { + await globalState?.securityController.updatePin(pin, repeatPin); + showDrawer = true; + } catch (error) { + console.error("Failed to update PIN:", error); + isError = true; + } }; - $effect(() => { - if (repeatPin && repeatPin.length === 4 && pin === repeatPin) - isError = false; - }); - - onMount(async () => { - globalState = getContext<() => GlobalState>("globalState")(); - if (!globalState) throw new Error("Global state is not defined"); - - isBiometricsAvailable = (await checkStatus()).isAvailable; - console.log("isBiometricsAvailable", isBiometricsAvailable); - - handleConfirm = async () => { - if (repeatPin.length < 4) { - isError = true; - return; - } - - if (pin !== repeatPin) { - isError = true; - firstStep = true; + handleSetupBiometrics = async () => { + if (!globalState) + throw new Error( + "Cannot set biometric support, Global state is not defined", + ); + if (isBiometricsAvailable) { + try { + globalState.securityController.biometricSupport = true; + } catch (error) { + console.error("Failed to enable biometric support:", error); + // Consider showing an error message to the user return; } - - isError = false; - showDrawer = true; - await globalState?.securityController.updatePin(pin, repeatPin); - }; - - handleSetupBiometrics = async () => { - if (!globalState) - throw new Error( - "Cannot set biometric support, Global state is not defined", - ); - if (isBiometricsAvailable) { - try { - globalState.securityController.biometricSupport = true; - } catch (error) { - console.error("Failed to enable biometric support:", error); - // Consider showing an error message to the user - return; - } - } - isBiometricsAdded = true; - }; - }); + } + isBiometricsAdded = true; + }; +}); {#if firstStep} From e0cc594837546488ef6e2528b8ac8fb764f447c1 Mon Sep 17 00:00:00 2001 From: gourav Date: Thu, 13 Nov 2025 16:18:56 +0530 Subject: [PATCH 4/9] fix: btn variants --- .../src/routes/(auth)/register/+page.svelte | 205 ++++++++++-------- 1 file changed, 113 insertions(+), 92 deletions(-) diff --git a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte index a28c0d5be..710501c02 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte @@ -1,101 +1,116 @@ {#if firstStep} @@ -116,7 +131,11 @@ onMount(async () => { Your PIN does not match, try again.

- + Confirm
@@ -132,8 +151,10 @@ onMount(async () => { - ConfirmConfirm {/if} From 4d34af20e937537c28196f6c2ba829d0e5e549c7 Mon Sep 17 00:00:00 2001 From: gourav Date: Thu, 13 Nov 2025 16:37:46 +0530 Subject: [PATCH 5/9] fix: conflicts --- .../src/lib/ui/InputPin/InputPin.svelte | 223 +++++++++--------- .../src/routes/(auth)/register/+page.svelte | 202 ++++++++-------- 2 files changed, 212 insertions(+), 213 deletions(-) diff --git a/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte b/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte index e994ce0ea..2040cf1ff 100644 --- a/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte +++ b/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte @@ -1,125 +1,124 @@
diff --git a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte index 710501c02..45ceec444 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte @@ -1,116 +1,116 @@ {#if firstStep} From 3e7c9971e2c9b0da178fbfde6572ebaf3ba20e18 Mon Sep 17 00:00:00 2001 From: gourav Date: Thu, 13 Nov 2025 16:40:48 +0530 Subject: [PATCH 6/9] fix: format --- .../src/routes/(auth)/login/+page.svelte | 268 +++++++++--------- 1 file changed, 130 insertions(+), 138 deletions(-) diff --git a/infrastructure/eid-wallet/src/routes/(auth)/login/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/login/+page.svelte index d6665ec96..154da03ea 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/login/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/login/+page.svelte @@ -1,152 +1,144 @@
Date: Thu, 13 Nov 2025 16:54:01 +0530 Subject: [PATCH 7/9] fix: lint --- infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte | 4 +++- .../eid-wallet/src/routes/(auth)/register/+page.svelte | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte b/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte index 2040cf1ff..a46b4657e 100644 --- a/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte +++ b/infrastructure/eid-wallet/src/lib/ui/InputPin/InputPin.svelte @@ -45,7 +45,9 @@ $effect(() => { $effect(() => { if (pin === "") { - Object.keys(pins).forEach((key) => (pins[+key] = "")); + for (const key of Object.keys(pins)) { + pins[+key] = ""; + } } }); diff --git a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte index 45ceec444..b29f8aca3 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/register/+page.svelte @@ -22,7 +22,8 @@ let globalState: GlobalState | undefined = $state(undefined); const handleFirstStep = async () => { if (pin.length === 4) { - (firstStep = false), (btnVariant = "solid"); + firstStep = false; + btnVariant = "solid"; } }; From 70073b6dc3d50104b4b14c7a8e98b2b73e547b0d Mon Sep 17 00:00:00 2001 From: gourav Date: Thu, 13 Nov 2025 17:12:20 +0530 Subject: [PATCH 8/9] fix: reset-pin --- .../routes/(app)/settings/pin/+page.svelte | 94 ++++++++++--------- 1 file changed, 52 insertions(+), 42 deletions(-) diff --git a/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte index 92e50e134..d1c48614d 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte @@ -1,53 +1,63 @@
Date: Thu, 13 Nov 2025 17:16:13 +0530 Subject: [PATCH 9/9] fix: format and lint --- .../routes/(app)/settings/pin/+page.svelte | 100 +++++++++--------- 1 file changed, 48 insertions(+), 52 deletions(-) diff --git a/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte index d1c48614d..8dff1c999 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/settings/pin/+page.svelte @@ -1,63 +1,59 @@