Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/(tabs)/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { Card } from '../../components/shared/Card';
import { useAuthStore } from '../../stores/auth.store';
import { useUserStore } from '../../stores/user.store';
import { useWalletStore } from '../../stores/wallet.store';
import { useLoansStore } from '../../stores/loans.store';
import { biometricService } from '../../src/security/biometric.service';
import { useTranslation } from '../../hooks/useTranslation';

Expand Down Expand Up @@ -92,6 +93,7 @@ export default function SettingsScreen() {
const profile = useUserStore((s) => s.profile);
const clearUser = useUserStore((s) => s.clearUser);
const disconnect = useWalletStore((s) => s.disconnect);
const clearLoans = useLoansStore((s) => s.clearLoans);
const [copied, setCopied] = useState(false);

const [biometricsEnabled, setBiometricsEnabled] = useState(false);
Expand Down Expand Up @@ -134,6 +136,7 @@ export default function SettingsScreen() {
onPress: async () => {
await disconnect();
clearUser();
clearLoans();
await clearAuth();
},
},
Expand Down
5 changes: 4 additions & 1 deletion src/components/BiometricGate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { evaluateFailedAttempt } from '../security/lockout';
import { useAuthStore } from '../../stores/auth.store';
import { useUserStore } from '../../stores/user.store';
import { useWalletStore } from '../../stores/wallet.store';
import { useLoansStore } from '../../stores/loans.store';

type GateMode = 'loading' | 'biometric' | 'pin' | 'error';

Expand All @@ -21,12 +22,14 @@ export function BiometricGate() {
const clearAuth = useAuthStore((s) => s.clearAuth);
const clearUser = useUserStore((s) => s.clearUser);
const disconnect = useWalletStore((s) => s.disconnect);
const clearLoans = useLoansStore((s) => s.clearLoans);

const handleLogout = useCallback(async () => {
await disconnect();
clearUser();
clearLoans();
await clearAuth();
}, [clearAuth, clearUser, disconnect]);
}, [clearAuth, clearUser, clearLoans, disconnect]);

const handleFailure = useCallback(async () => {
const store = useSecurityStore.getState();
Expand Down
Loading