Skip to content

Commit

Permalink
fix(setup-wallet): avoid intial flow if the user has wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed Apr 10, 2024
1 parent ff4cb12 commit 42e1414
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/wallet-mobile/src/WalletNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ import {NftDetailsNavigator} from './NftDetails/NftDetailsNavigator'
import {NftsNavigator} from './Nfts/NftsNavigator'
import {SearchProvider} from './Search/SearchContext'
import {TxHistoryNavigator} from './TxHistory'
import {useWalletManager} from './wallet-manager/WalletManagerContext'
import {useAuthOsEnabled} from './yoroi-wallets/auth'
import {isHaskellShelley} from './yoroi-wallets/cardano/utils'
import {useHasWallets} from './yoroi-wallets/hooks'

const Tab = createBottomTabNavigator<WalletTabRoutes>()
const WalletTabNavigator = () => {
Expand Down Expand Up @@ -151,6 +153,8 @@ export const WalletNavigator = () => {
useLinksRequestAction()
const authOsEnabled = useAuthOsEnabled()
const {showBiometricsScreen} = useShowBiometricsScreen()
const walletManager = useWalletManager()
const hasWallets = useHasWallets(walletManager)

// initialRoute doesn't update the state of the navigator, only at first render
// https://reactnavigation.org/docs/auth-flow/
Expand All @@ -175,7 +179,7 @@ export const WalletNavigator = () => {
detachPreviousScreen: false /* https://github.com/react-navigation/react-navigation/issues/9883 */,
}}
>
{showBiometricsScreen && authOsEnabled && (
{!hasWallets && showBiometricsScreen && authOsEnabled && (
<Stack.Screen //
name="choose-biometric-login"
options={{headerShown: false}}
Expand Down

0 comments on commit 42e1414

Please sign in to comment.