Skip to content

Commit 4bde66f

Browse files
committed
Save PIN on pin creation screen
1 parent a2dd101 commit 4bde66f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/mobile-app/app/onboarding/create-pin.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export default function CreatePin() {
9090
const { next } = useLocalSearchParams();
9191
const facade = useFacade();
9292
const createAccount = facade.createAccount.useMutation();
93+
const setAppSetting = facade.setAppSetting.useMutation();
9394
const isImportFlow = next === "import-account";
9495

9596
const isPinValid = (pin: string) => {
@@ -127,6 +128,17 @@ export default function CreatePin() {
127128
return;
128129
}
129130

131+
try {
132+
// Save the PIN when it's confirmed
133+
await setAppSetting.mutateAsync({
134+
key: "pin",
135+
value: pinValue,
136+
});
137+
} catch {
138+
setError("Failed to save PIN. Please try again.");
139+
return;
140+
}
141+
130142
// If we're in the import flow, go to import selection
131143
if (next === "import-account") {
132144
router.push("/onboarding/import-account");

0 commit comments

Comments
 (0)