diff --git a/src/screens/NanoContract/NanoContractRegisterScreen.js b/src/screens/NanoContract/NanoContractRegisterScreen.js index 220262230..24ea64a74 100644 --- a/src/screens/NanoContract/NanoContractRegisterScreen.js +++ b/src/screens/NanoContract/NanoContractRegisterScreen.js @@ -46,6 +46,7 @@ import errorIcon from '../../assets/images/icErrorBig.png'; import checkIcon from '../../assets/images/icCheckBig.png'; import { FeedbackContent } from '../../components/FeedbackContent'; import { hasError } from '../../utils'; +import NavigationService from '../../NavigationService'; /** * Validates the formModel, returning the invalidModel. @@ -255,7 +256,7 @@ const FieldContainer = ({ last, children }) => ( const NavigationHeader = ({ navigation }) => ( navigation.goBack()} + onBackPress={() => NavigationService.resetToMain()} /> ); diff --git a/src/screens/RegisterTokenManual.js b/src/screens/RegisterTokenManual.js index 335e7e34d..6c46e23c3 100644 --- a/src/screens/RegisterTokenManual.js +++ b/src/screens/RegisterTokenManual.js @@ -124,7 +124,7 @@ class RegisterTokenManual extends React.Component { this.props.navigation.goBack()} + onBackPress={() => NavigationService.resetToMain()} /> diff --git a/src/screens/Reown/ReownList.js b/src/screens/Reown/ReownList.js index cb6013fa0..d3e9696d2 100644 --- a/src/screens/Reown/ReownList.js +++ b/src/screens/Reown/ReownList.js @@ -7,7 +7,6 @@ import React from 'react'; import { useSelector, useDispatch } from 'react-redux'; -import { StackActions } from '@react-navigation/native'; import { t } from 'ttag'; import { get } from 'lodash'; import { @@ -30,6 +29,7 @@ import { setWCConnectionFailed, } from '../../actions'; import { COLORS } from '../../styles/themes'; +import NavigationService from '../../NavigationService'; const connectFailedText = t`There was an error connecting. Please try again later.`; @@ -133,8 +133,7 @@ export default function ReownList({ navigation }) { }; const onBackPress = () => { - const popToAction = StackActions.popTo('Main'); - navigation.dispatch(popToAction); + NavigationService.resetToMain(); } return ( diff --git a/src/screens/SendAddressInput.js b/src/screens/SendAddressInput.js index df2c27bab..15b474d6e 100644 --- a/src/screens/SendAddressInput.js +++ b/src/screens/SendAddressInput.js @@ -17,6 +17,7 @@ import SimpleInput from '../components/SimpleInput'; import HathorHeader from '../components/HathorHeader'; import { getKeyboardAvoidingViewTopDistance, validateAddress } from '../utils'; import OfflineBar from '../components/OfflineBar'; +import NavigationService from '../NavigationService'; export const SendAddressInput = () => { const route = useRoute(); @@ -51,7 +52,7 @@ export const SendAddressInput = () => { navigation.goBack()} + onBackPress={() => NavigationService.resetToMain()} /> diff --git a/src/screens/SendConfirmScreen.js b/src/screens/SendConfirmScreen.js index bd1fbdd47..8bf9301d8 100644 --- a/src/screens/SendConfirmScreen.js +++ b/src/screens/SendConfirmScreen.js @@ -103,7 +103,7 @@ const SendConfirmScreen = () => { initialRoute = 'SendAddressInput'; } - NavigationService.navigate('Main', { screen: 'Home' }); + NavigationService.resetToMain(); // Give enough time for the navigation to complete so the user doesn't see // the SendStack reseting to the initial route.