diff --git a/src/components/postDropdown/container/postDropdownContainer.tsx b/src/components/postDropdown/container/postDropdownContainer.tsx index 3aa04a158..31b3e43b4 100644 --- a/src/components/postDropdown/container/postDropdownContainer.tsx +++ b/src/components/postDropdown/container/postDropdownContainer.tsx @@ -6,14 +6,13 @@ import { injectIntl } from 'react-intl'; import get from 'lodash/get'; // Services and Actions -import { followUser, getRelationship, ignoreUser, pinCommunityPost, profileUpdate, reblog, unfollowUser } from '../../../providers/hive/dhive'; +import { ignoreUser, pinCommunityPost, profileUpdate, reblog } from '../../../providers/hive/dhive'; import { addBookmark, addReport } from '../../../providers/ecency/ecency'; import { toastNotification, setRcOffer, showActionModal } from '../../../redux/actions/uiAction'; -import { openPinCodeModal } from '../../../redux/actions/applicationActions'; // Constants import OPTIONS from '../../../constants/options/post'; -import { default as ROUTES } from '../../../constants/routeNames'; +import ROUTES from '../../../constants/routeNames'; // Utilities import { writeToClipboard } from '../../../utils/clipboard'; @@ -429,7 +428,7 @@ class PostDropdownContainer extends PureComponent { }; _redirectToPromote = (routeName, from, redeemType) => { - const { content, isLoggedIn, navigation, dispatch, isPinCodeOpen } = this.props as any; + const { content, isLoggedIn, navigation, isPinCodeOpen } = this.props as any; const params = { from, permlink: `${get(content, 'author')}/${get(content, 'permlink')}`, @@ -437,12 +436,14 @@ class PostDropdownContainer extends PureComponent { }; if (isPinCodeOpen) { - dispatch( - openPinCodeModal({ + navigation.navigate({ + routeName:ROUTES.SCREENS.PINCODE, + params:{ navigateTo: routeName, navigateParams: params, - } as any) - ); + } + }) + } else if (isLoggedIn) { navigation.navigate({ routeName, diff --git a/src/components/walletDetails/container/walletDetailsContainer.js b/src/components/walletDetails/container/walletDetailsContainer.js index f175897ad..d1aced9ca 100644 --- a/src/components/walletDetails/container/walletDetailsContainer.js +++ b/src/components/walletDetails/container/walletDetailsContainer.js @@ -5,8 +5,6 @@ import { connect } from 'react-redux'; // Constants import ROUTES from '../../../constants/routeNames'; -import { openPinCodeModal } from '../../../redux/actions/applicationActions'; - // Component import WalletDetailsView from '../view/walletDetailsView'; @@ -48,12 +46,13 @@ class WalletContainer extends PureComponent { } if (isPinCodeOpen) { - dispatch( - openPinCodeModal({ + navigation.navigate({ + routeName: ROUTES.SCREENS.PINCODE, + params: { navigateTo: ROUTES.SCREENS.TRANSFER, navigateParams: { transferType, fundType, balance }, - }), - ); + }, + }); } else { navigation.navigate({ routeName: ROUTES.SCREENS.TRANSFER, diff --git a/src/containers/pointsContainer.js b/src/containers/pointsContainer.js index 7b4e01a65..262caff18 100644 --- a/src/containers/pointsContainer.js +++ b/src/containers/pointsContainer.js @@ -7,7 +7,6 @@ import { withNavigation } from '@react-navigation/compat'; // Services and Actions import { getPointsSummary, claimPoints, getPointsHistory } from '../providers/ecency/ePoint'; -import { openPinCodeModal } from '../redux/actions/applicationActions'; import { getAccount, boost } from '../providers/hive/dhive'; import { getUserDataWithUsername } from '../realm/realm'; import { toastNotification } from '../redux/actions/uiAction'; @@ -100,12 +99,13 @@ const PointsContainer = ({ } if (isPinCodeOpen) { - dispatch( - openPinCodeModal({ - navigateTo, - navigateParams, - }), - ); + navigation.navigate({ + routeName: ROUTES.SCREENS.PINCODE, + params: { + routeName: navigateTo, + params: navigateParams, + }, + }); } else { navigation.navigate({ routeName: navigateTo, diff --git a/src/containers/walletContainer.js b/src/containers/walletContainer.js index 35797ee74..04a72ce55 100644 --- a/src/containers/walletContainer.js +++ b/src/containers/walletContainer.js @@ -8,9 +8,6 @@ import { toastNotification } from '../redux/actions/uiAction'; // dhive import { getAccount, claimRewardBalance, getBtcAddress } from '../providers/hive/dhive'; -// Actions -import { openPinCodeModal } from '../redux/actions/applicationActions'; - // Utils import { groomingWalletData, groomingTransactionData, transferTypes } from '../utils/wallet'; import parseToken from '../utils/parseToken'; @@ -255,12 +252,13 @@ const WalletContainer = ({ } if (isPinCodeOpen) { - dispatch( - openPinCodeModal({ + navigate({ + routeName: ROUTES.SCREENS.PINCODE, + params: { navigateTo: ROUTES.SCREENS.TRANSFER, navigateParams: { transferType, fundType, balance, tokenAddress }, - }), - ); + }, + }); } else { navigate({ routeName: ROUTES.SCREENS.TRANSFER, diff --git a/src/screens/application/container/applicationContainer.tsx b/src/screens/application/container/applicationContainer.tsx index 7bfc03f3d..94c37522c 100644 --- a/src/screens/application/container/applicationContainer.tsx +++ b/src/screens/application/container/applicationContainer.tsx @@ -61,7 +61,6 @@ import { isDarkTheme, login, logoutDone, - openPinCodeModal, setConnectivityStatus, setAnalyticsStatus, setPinCode as savePinCode, diff --git a/src/screens/coinDetails/screen/coinDetailsScreen.tsx b/src/screens/coinDetails/screen/coinDetailsScreen.tsx index 48fcc3357..e489d1b7c 100644 --- a/src/screens/coinDetails/screen/coinDetailsScreen.tsx +++ b/src/screens/coinDetails/screen/coinDetailsScreen.tsx @@ -8,7 +8,6 @@ import { useAppDispatch, useAppSelector } from '../../../hooks' import { CoinActivitiesCollection, QuoteItem } from '../../../redux/reducers/walletReducer'; import { fetchCoinActivities } from '../../../utils/wallet'; import { fetchAndSetCoinsData, setCoinActivities } from '../../../redux/actions/walletActions'; -import { openPinCodeModal } from '../../../redux/actions/applicationActions'; import { navigate } from '../../../navigation/service'; import ROUTES from '../../../constants/routeNames'; import { COIN_IDS } from '../../../constants/defaultCoins'; @@ -130,12 +129,13 @@ const CoinDetailsScreen = ({ navigation, route }: CoinDetailsScreenProps) => { } if (isPinCodeOpen) { - dispatch( - openPinCodeModal({ + navigate({ + routeName: ROUTES.SCREENS.PINCODE, + params:{ navigateTo, navigateParams, - }), - ); + } + }) } else { navigate({ routeName: navigateTo, diff --git a/src/screens/login/container/loginContainer.js b/src/screens/login/container/loginContainer.js index 0b55fd34d..f08538d13 100644 --- a/src/screens/login/container/loginContainer.js +++ b/src/screens/login/container/loginContainer.js @@ -14,11 +14,7 @@ import { addOtherAccount, updateCurrentAccount, } from '../../../redux/actions/accountAction'; -import { - login as loginAction, - openPinCodeModal, - setPinCode, -} from '../../../redux/actions/applicationActions'; +import { login as loginAction, setPinCode } from '../../../redux/actions/applicationActions'; import { setInitPosts, setFeedPosts } from '../../../redux/actions/postsAction'; import { setPushTokenSaved, setExistUser } from '../../../realm/realm'; import { setPushToken } from '../../../providers/ecency/ecency'; @@ -79,7 +75,12 @@ class LoginContainer extends PureComponent { dispatch(setPinCode(encryptedPin)); if (isPinCodeOpen) { - dispatch(openPinCodeModal({ navigateTo: ROUTES.DRAWER.MAIN })); + navigation.navigate({ + name: ROUTES.SCREENS.PINCODE, + params: { + navigateTo: ROUTES.DRAWER.MAIN, + }, + }); } else { navigation.navigate({ name: ROUTES.DRAWER.MAIN, diff --git a/src/screens/pinCode/screen/pinCodeScreen.tsx b/src/screens/pinCode/screen/pinCodeScreen.tsx index 1e5674909..f04bba95b 100644 --- a/src/screens/pinCode/screen/pinCodeScreen.tsx +++ b/src/screens/pinCode/screen/pinCodeScreen.tsx @@ -1,13 +1,11 @@ import React, { useEffect, useRef } from 'react' -import { Alert, AppState, View } from 'react-native'; +import { AppState } from 'react-native'; import { useAppDispatch, useAppSelector } from '../../../hooks' import { getExistUser } from '../../../realm/realm'; -import { openPinCodeModal } from '../../../redux/actions/applicationActions'; -import { BasicHeader } from '../../../components'; + import PinCodeContainer from '../container/pinCodeContainer'; -import ROUTE from '../../../constants/routeNames'; import { navigate } from '../../../navigation/service'; import routeNames from '../../../constants/routeNames'; diff --git a/src/screens/steem-connect/hiveSigner.js b/src/screens/steem-connect/hiveSigner.js index 7ce846bae..c25c450ec 100644 --- a/src/screens/steem-connect/hiveSigner.js +++ b/src/screens/steem-connect/hiveSigner.js @@ -10,7 +10,7 @@ import { hsOptions } from '../../constants/hsOptions'; // Actions import { addOtherAccount, updateCurrentAccount } from '../../redux/actions/accountAction'; -import { login as loginAction, openPinCodeModal } from '../../redux/actions/applicationActions'; +import { login as loginAction } from '../../redux/actions/applicationActions'; // Constants import { default as ROUTES } from '../../constants/routeNames'; @@ -51,12 +51,13 @@ class HiveSigner extends PureComponent { dispatch(loginAction(true)); if (isPinCodeOpen) { - dispatch( - openPinCodeModal({ + navigation.navigate({ + routeName: ROUTES.SCREENS.PINCODE, + params: { accessToken: result.accessToken, navigateTo: ROUTES.DRAWER.MAIN, - }), - ); + }, + }); } else { navigation.navigate({ routeName: ROUTES.DRAWER.MAIN,