Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/3052 navigator undefined #3100

Merged
merged 2 commits into from
Sep 7, 2021
Merged
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
6 changes: 5 additions & 1 deletion app/components/UI/ApproveTransactionReview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,11 @@ class ApproveTransactionReview extends PureComponent {
const { navigation } = this.props;
/* this is kinda weird, we have to reject the transaction to collapse the modal */
this.onCancelPress();
navigation.navigate('FiatOnRamp');
try {
navigation.navigate('FiatOnRamp');
} catch (error) {
Logger.error(error, 'Navigation: Error when navigating to buy ETH.');
}
InteractionManager.runAfterInteractions(() => {
Analytics.trackEvent(ANALYTICS_EVENT_OPTS.RECEIVE_OPTIONS_PAYMENT_REQUEST);
});
Expand Down
7 changes: 6 additions & 1 deletion app/components/UI/Swaps/QuotesView.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import { toLowerCaseEquals } from '../../../util/general';
import { swapsTokensSelector } from '../../../reducers/swaps';
import { decGWEIToHexWEI } from '../../../util/conversions';
import FadeAnimationView from '../FadeAnimationView';
import Logger from '../../../util/Logger';

const POLLING_INTERVAL = 30000;
const SLIPPAGE_BUCKETS = {
Expand Down Expand Up @@ -883,7 +884,11 @@ function SwapsQuotesView({
}, [selectedQuote]);

const buyEth = useCallback(() => {
navigation.navigate('FiatOnRamp');
try {
navigation.navigate('FiatOnRamp');
} catch (error) {
Logger.error(error, 'Navigation: Error when navigating to buy ETH.');
}
InteractionManager.runAfterInteractions(() => {
Analytics.trackEvent(ANALYTICS_EVENT_OPTS.RECEIVE_OPTIONS_PAYMENT_REQUEST);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { setNonce, setProposedNonce } from '../../../../actions/transaction';
import TransactionReviewEIP1559 from '../TransactionReviewEIP1559';
import { GAS_ESTIMATE_TYPES } from '@metamask/controllers';
import CustomNonce from '../../../UI/CustomNonce';
import Logger from '../../../../util/Logger';

const styles = StyleSheet.create({
overviewAlert: {
Expand Down Expand Up @@ -241,7 +242,11 @@ class TransactionReviewInformation extends PureComponent {
const { navigation } = this.props;
/* this is kinda weird, we have to reject the transaction to collapse the modal */
this.onCancelPress();
navigation.navigate('FiatOnRamp');
try {
navigation.navigate('FiatOnRamp');
} catch (error) {
Logger.error(error, 'Navigation: Error when navigating to buy ETH.');
}
InteractionManager.runAfterInteractions(() => {
Analytics.trackEvent(ANALYTICS_EVENT_OPTS.RECEIVE_OPTIONS_PAYMENT_REQUEST);
});
Expand Down
6 changes: 5 additions & 1 deletion app/components/Views/SendFlow/Confirm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,11 @@ class Confirm extends PureComponent {

buyEth = () => {
const { navigation } = this.props;
navigation.navigate('FiatOnRamp');
try {
navigation.navigate('FiatOnRamp');
} catch (error) {
Logger.error(error, 'Navigation: Error when navigating to buy ETH.');
}
InteractionManager.runAfterInteractions(() => {
Analytics.trackEvent(ANALYTICS_EVENT_OPTS.RECEIVE_OPTIONS_PAYMENT_REQUEST);
});
Expand Down