Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/screens/NanoContract/NanoContractRegisterScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -255,7 +256,7 @@ const FieldContainer = ({ last, children }) => (
const NavigationHeader = ({ navigation }) => (
<HathorHeader
title={t`Nano Contract Registration`.toUpperCase()}
onBackPress={() => navigation.goBack()}
onBackPress={() => NavigationService.resetToMain()}
/>
);

Expand Down
2 changes: 1 addition & 1 deletion src/screens/RegisterTokenManual.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class RegisterTokenManual extends React.Component {
<HathorHeader
withBorder
title={t`REGISTER TOKEN`}
onBackPress={() => this.props.navigation.goBack()}
onBackPress={() => NavigationService.resetToMain()}
/>
<View style={{ flex: 1, padding: 16, justifyContent: 'space-between' }}>
<View>
Expand Down
5 changes: 2 additions & 3 deletions src/screens/Reown/ReownList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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.`;

Expand Down Expand Up @@ -133,8 +133,7 @@ export default function ReownList({ navigation }) {
};

const onBackPress = () => {
const popToAction = StackActions.popTo('Main');
navigation.dispatch(popToAction);
NavigationService.resetToMain();
}

return (
Expand Down
3 changes: 2 additions & 1 deletion src/screens/SendAddressInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -51,7 +52,7 @@ export const SendAddressInput = () => {
<HathorHeader
withBorder
title={t`SEND`}
onBackPress={() => navigation.goBack()}
onBackPress={() => NavigationService.resetToMain()}
/>
<KeyboardAvoidingView behavior='padding' style={{ flex: 1 }} keyboardVerticalOffset={getKeyboardAvoidingViewTopDistance()}>
<View style={{ flex: 1, padding: 16, justifyContent: 'space-between' }}>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/SendConfirmScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down