From fb82081e5447129a88d4e88c6237c5ca65eacaf2 Mon Sep 17 00:00:00 2001 From: neven-s Date: Mon, 11 Dec 2023 21:06:02 +0100 Subject: [PATCH] Put LoginWithPinOrBiometryScreen as overlay on WalletScreenStack (#1101) --- packages/core-mobile/app/navigation/AppNavigation.ts | 3 +-- .../core-mobile/app/navigation/RootScreenStack.tsx | 10 +++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/core-mobile/app/navigation/AppNavigation.ts b/packages/core-mobile/app/navigation/AppNavigation.ts index f4a73849d6..3da41c917d 100644 --- a/packages/core-mobile/app/navigation/AppNavigation.ts +++ b/packages/core-mobile/app/navigation/AppNavigation.ts @@ -3,8 +3,7 @@ enum Root { Onboard = 'Root.Onboard', RefreshToken = 'Root.RefreshToken', CopyPhraseWarning = 'Root.CopyPhraseWarning', - ForgotPin = 'Root.ForgotPin', - Login = 'Root.Login' + ForgotPin = 'Root.ForgotPin' } enum OnboardScreens { diff --git a/packages/core-mobile/app/navigation/RootScreenStack.tsx b/packages/core-mobile/app/navigation/RootScreenStack.tsx index 9b1e87cd59..17686a580a 100644 --- a/packages/core-mobile/app/navigation/RootScreenStack.tsx +++ b/packages/core-mobile/app/navigation/RootScreenStack.tsx @@ -43,7 +43,6 @@ export type RootScreenStackParamList = { title: string message: string } - [AppNavigation.Root.Login]: undefined } const RootStack = createStackNavigator() @@ -51,6 +50,7 @@ const RootStack = createStackNavigator() const WalletScreenStackWithContext: FC = () => { const { onExit } = useApplicationContext().appHook const { inBackground } = useBgDetect() + const walletState = useSelector(selectWalletState) const doExit = useCallback(() => { onExit((confirmExit, cancel) => { @@ -75,6 +75,7 @@ const WalletScreenStackWithContext: FC = () => { return ( <> + {walletState === WalletState.INACTIVE && } {/* This protects from leaking last screen in "recent apps" list. */} {/* For Android it is additionally implemented natively in MainActivity.java because react-native */} @@ -101,7 +102,7 @@ const RootScreenStack: FC = () => { animationEnabled: false }} /> - ) : walletState === WalletState.ACTIVE ? ( + ) : ( { presentation: 'card' }} /> - ) : ( - )}