diff --git a/app/(tabs)/settings.tsx b/app/(tabs)/settings.tsx index e1c4d71..931ffd5 100644 --- a/app/(tabs)/settings.tsx +++ b/app/(tabs)/settings.tsx @@ -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'; @@ -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); @@ -134,6 +136,7 @@ export default function SettingsScreen() { onPress: async () => { await disconnect(); clearUser(); + clearLoans(); await clearAuth(); }, }, diff --git a/src/components/BiometricGate.tsx b/src/components/BiometricGate.tsx index ee26058..ca744c3 100644 --- a/src/components/BiometricGate.tsx +++ b/src/components/BiometricGate.tsx @@ -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'; @@ -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();