Skip to content

Commit 3ade052

Browse files
committed
Merge main, fix conflicts
2 parents 6323f8b + 0e1725c commit 3ade052

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

packages/mobile-app/app/(drawer)/account/index.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,6 @@ function AssetRow({
336336
{amount}
337337
</Text>
338338
</Layout>
339-
<Icon
340-
style={styles.chevron}
341-
fill="#8F9BB3"
342-
name="chevron-right-outline"
343-
/>
344339
</Layout>
345340
</Card>
346341
);
@@ -409,10 +404,6 @@ const styles = StyleSheet.create({
409404
gap: 4,
410405
flex: 1,
411406
},
412-
chevron: {
413-
width: 24,
414-
height: 24,
415-
},
416407
syncCard: {
417408
margin: 16,
418409
marginTop: 0,

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import { PinInputComponent } from "../PinInputComponent";
1111
import { Button, Modal, Card, Text } from "@ui-kitten/components";
1212
import { useCallback, useEffect, useRef, useState } from "react";
13+
import { useSegments } from "expo-router";
1314

1415
const LOCK_TIMEOUT = 60 * 1000 * 5; // 5 minutes of inactivity
1516

@@ -19,6 +20,8 @@ export function PinLockScreen({ children }: { children?: React.ReactNode }) {
1920
const setAppSetting = facade.setAppSetting.useMutation();
2021
const removeAllAccounts = facade.removeAllAccounts.useMutation();
2122
const pin = appSettings.data?.pin;
23+
const segments = useSegments();
24+
const inOnboarding = segments[0] === "onboarding";
2225

2326
const [isLocked, setIsLocked] = useState(true);
2427
const [enteredPin, setEnteredPin] = useState("");
@@ -27,6 +30,12 @@ export function PinLockScreen({ children }: { children?: React.ReactNode }) {
2730
const lastActiveTimestamp = useRef(Date.now());
2831
const lockTimeoutRef = useRef<NodeJS.Timeout>();
2932

33+
useEffect(() => {
34+
if (pin === "" || inOnboarding) {
35+
setIsLocked(false);
36+
}
37+
}, [pin, inOnboarding]);
38+
3039
const resetLockTimeout = useCallback(() => {
3140
if (lockTimeoutRef.current) {
3241
clearTimeout(lockTimeoutRef.current);
@@ -47,7 +56,7 @@ export function PinLockScreen({ children }: { children?: React.ReactNode }) {
4756
if (nextAppState === "active") {
4857
// When app comes to foreground, check if we should lock
4958
const timeSinceLastActive = Date.now() - lastActiveTimestamp.current;
50-
if (timeSinceLastActive >= LOCK_TIMEOUT) {
59+
if (timeSinceLastActive >= LOCK_TIMEOUT && !inOnboarding) {
5160
setIsLocked(true);
5261
}
5362
resetLockTimeout();
@@ -64,7 +73,7 @@ export function PinLockScreen({ children }: { children?: React.ReactNode }) {
6473
return () => {
6574
subscription.remove();
6675
};
67-
}, [isLocked, resetLockTimeout]);
76+
}, [isLocked, resetLockTimeout, inOnboarding]);
6877

6978
// Initial setup of the lock timer
7079
useEffect(() => {
@@ -106,6 +115,7 @@ export function PinLockScreen({ children }: { children?: React.ReactNode }) {
106115
{/* Lock screen overlay */}
107116
{!!pin &&
108117
isLocked &&
118+
!inOnboarding &&
109119
process.env.EXPO_PUBLIC_DISABLE_PIN_LOCK !== "true" && (
110120
<View style={styles.lockOverlay}>
111121
<SafeAreaView style={styles.lockContent}>

0 commit comments

Comments
 (0)