Skip to content

refactor: ignore confirmation modal #544

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

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { useDispatch, useSelector } from 'react-redux';
import { ModalBase } from '../../ModalBase';
import { walletConnectReject } from '../../../actions';
import { WarnDisclaimer } from '../WarnDisclaimer';
import { WALLETCONNECT_SKIP_CONFIRMATION_MODAL } from '../../../config';

export const NewNanoContractTransactionModal = ({
onDismiss,
Expand All @@ -38,7 +39,7 @@ export const NewNanoContractTransactionModal = ({
};

useEffect(() => {
if (isRetrying) {
if (WALLETCONNECT_SKIP_CONFIRMATION_MODAL || isRetrying) {
navigatesToNewNanoContractScreen();
}
}, [isRetrying]);
Expand Down
9 changes: 8 additions & 1 deletion src/components/WalletConnect/SignMessageModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import React from 'react';
import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { useNavigation } from '@react-navigation/native';
import { t } from 'ttag';
Expand All @@ -14,6 +14,7 @@ import { COLORS } from '../../styles/themes';
import { ModalBase } from '../ModalBase';
import { WarnDisclaimer } from './WarnDisclaimer';
import { walletConnectReject } from '../../actions';
import { WALLETCONNECT_SKIP_CONFIRMATION_MODAL } from '../../config';

const styles = StyleSheet.create({
body: {
Expand Down Expand Up @@ -51,6 +52,12 @@ export default ({
navigation.navigate('SignMessageRequest', { signMessageRequest: data });
};

useEffect(() => {
if (WALLETCONNECT_SKIP_CONFIRMATION_MODAL) {
navigateToSignMessageRequestScreen();
}
}, []);

return (
<ModalBase show onDismiss={onReject}>
<ModalBase.Title>{t`New Sign Message Request`}</ModalBase.Title>
Expand Down
5 changes: 5 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,8 @@ export const _PRIMARY_COLOR = '#8C46FF';
* Sentry DSN to send errors
*/
export const _SENTRY_DSN = 'https://[email protected]/5304101';

/**
* Whether we should skip the initial modal on wallet-connect requests
*/
export const WALLETCONNECT_SKIP_CONFIRMATION_MODAL = true;