diff --git a/components/WalletHeader.tsx b/components/WalletHeader.tsx index f8ebcfde8..2da7034a2 100644 --- a/components/WalletHeader.tsx +++ b/components/WalletHeader.tsx @@ -27,6 +27,25 @@ import { Row } from '../components/layout/Row'; const Contact = require('../assets/images/Mascot.png'); +const protectedNavigation = async ( + navigation: any, + route: string, + disactivatePOS?: boolean +) => { + const { posStatus, settings, setPosStatus } = stores.settingsStore; + const loginRequired = settings && (settings.passphrase || settings.pin); + const posEnabled = posStatus === 'active'; + + if (posEnabled && loginRequired) { + navigation.navigate('Lockscreen', { + attemptAdminLogin: true + }); + } else { + if (disactivatePOS) await setPosStatus('inactive'); + navigation.navigate(route); + } +}; + const OpenChannelButton = ({ navigation }: { navigation: any }) => (