Skip to content

Commit 1040e31

Browse files
committed
Inline function
1 parent 332a47f commit 1040e31

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

packages/mobile-app/components/PinLockScreen/PinLockScreen.tsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,6 @@ export function PinLockScreen({ children }: { children?: React.ReactNode }) {
7373
};
7474
}, [isLocked, resetLockTimeout]);
7575

76-
const handlePinSubmit = () => {
77-
if (enteredPin === pin) {
78-
setIsLocked(false);
79-
setEnteredPin("");
80-
setError(null);
81-
resetLockTimeout();
82-
} else {
83-
setError("Incorrect PIN");
84-
setEnteredPin("");
85-
}
86-
};
87-
8876
return (
8977
<TouchableWithoutFeedback onPress={resetLockTimeout}>
9078
<View style={styles.container}>
@@ -104,7 +92,17 @@ export function PinLockScreen({ children }: { children?: React.ReactNode }) {
10492
setError={setError}
10593
/>
10694
<Button
107-
onPress={handlePinSubmit}
95+
onPress={() => {
96+
if (enteredPin === pin) {
97+
setIsLocked(false);
98+
setEnteredPin("");
99+
setError(null);
100+
resetLockTimeout();
101+
} else {
102+
setError("Incorrect PIN");
103+
setEnteredPin("");
104+
}
105+
}}
108106
disabled={enteredPin.length !== pin.length}
109107
>
110108
Unlock

0 commit comments

Comments
 (0)