From c72d5afc92456402cd60a74a45d4b32442bdb9a1 Mon Sep 17 00:00:00 2001 From: KKA11010 Date: Sun, 19 Nov 2023 17:52:34 +0100 Subject: [PATCH] remove navigation event that exits app --- src/components/App.tsx | 3 +++ src/screens/Dashboard.tsx | 9 +-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 6a4ffbe7..351867eb 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -140,6 +140,9 @@ function _App() { } const handlePinForeground = async () => { + // check if app has pw + const pw = await secureStore.get(SECURESTORE_KEY) + if (isNull(pw)) { return } // check if app is locked const now = Math.ceil(Date.now() / 1000) const lockData = await store.getObj(STORE_KEYS.lock) diff --git a/src/screens/Dashboard.tsx b/src/screens/Dashboard.tsx index 95da99b7..119313cf 100644 --- a/src/screens/Dashboard.tsx +++ b/src/screens/Dashboard.tsx @@ -29,7 +29,7 @@ import { claimToken, getMintsForPayment } from '@wallet' import { getTokenInfo } from '@wallet/proofs' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' -import { BackHandler, StyleSheet, TouchableOpacity, View } from 'react-native' +import { StyleSheet, TouchableOpacity, View } from 'react-native' export default function Dashboard({ navigation, route }: TDashboardPageProps) { const { t } = useTranslation([NS.common]) @@ -284,13 +284,6 @@ export default function Dashboard({ navigation, route }: TDashboardPageProps) { return focusHandler }, [navigation]) - // prevent back navigation - https://reactnavigation.org/docs/preventing-going-back/ - useEffect(() => { - const backHandler = () => BackHandler.exitApp() - navigation.addListener('beforeRemove', backHandler) - return () => navigation.removeListener('beforeRemove', backHandler) - }, [navigation]) - return ( {/* Balance, Disclaimer & History */}