From fec34fa921a9e9429710b19ab887dfa25f2cc22f Mon Sep 17 00:00:00 2001 From: Evan Kaloudis Date: Fri, 10 Feb 2023 00:21:40 -0500 Subject: [PATCH] WalletHeader: SettingsButton: long-press to nav to Nodes --- components/WalletHeader.tsx | 63 ++++++++++++++----------------------- 1 file changed, 24 insertions(+), 39 deletions(-) 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 }) => (