Fixed transfer route problem

This commit is contained in:
Mustafa Buyukcelebi 2019-05-03 13:54:05 +03:00
parent 300a5b7752
commit d6ee8c821d
18 changed files with 26 additions and 41 deletions

View File

@ -9,3 +9,4 @@ PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/FLAnimatedImage/FLAnimatedImage

View File

@ -9,3 +9,4 @@ PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/FLAnimatedImage/FLAnimatedImage

View File

@ -8,3 +8,4 @@ PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/FLAnimatedImage/FLAnimatedImage

View File

@ -8,3 +8,4 @@ PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/FLAnimatedImage/FLAnimatedImage

View File

@ -139,7 +139,7 @@ class WalletContainer extends Component {
render() {
const {
currentAccount, selectedUser, isDarkTheme, setPinCodeState,
currentAccount, selectedUser, isDarkTheme,
} = this.props;
const { walletData, isClaiming, isRefreshing } = this.state;
@ -153,7 +153,6 @@ class WalletContainer extends Component {
handleOnWalletRefresh={this._handleOnWalletRefresh}
isRefreshing={isRefreshing}
isDarkTheme={isDarkTheme}
setPinCodeState={setPinCodeState}
/>
);
}

View File

@ -55,7 +55,6 @@ class WalletView extends PureComponent {
selectedUsername,
walletData,
isDarkTheme,
setPinCodeState,
} = this.props;
return (
@ -117,7 +116,6 @@ class WalletView extends PureComponent {
<WalletDetails
intl={intl}
walletData={walletData}
setPinCodeState={setPinCodeState}
/>
</CollapsibleCard>
<Transaction walletData={walletData} />

View File

@ -27,7 +27,7 @@ class WalletContainer extends PureComponent {
// Component Functions
_navigate = async (transferType, fundType) => {
const { dispatch, setPinCodeState, walletData } = this.props;
const { dispatch, walletData } = this.props;
let balance;
switch (fundType) {
@ -41,11 +41,10 @@ class WalletContainer extends PureComponent {
break;
}
await setPinCodeState({
dispatch(openPinCodeModal({
navigateTo: ROUTES.SCREENS.TRANSFER,
navigateParams: { transferType, fundType, balance },
});
dispatch(openPinCodeModal());
}));
};
render() {

View File

@ -43,7 +43,8 @@ export const isLoginDone = () => ({
type: IS_LOGIN_DONE,
});
export const openPinCodeModal = () => ({
export const openPinCodeModal = payload => ({
payload,
type: OPEN_PIN_CODE_MODAL,
});

View File

@ -40,6 +40,7 @@ const initialState = {
isLogingOut: false,
isNotificationOpen: true,
isPinCodeReqiure: false,
pinCodeNavigation: {},
language: 'en-US',
loading: false, // It is lock to all screen and shows loading animation.
notificationDetails: {
@ -85,6 +86,7 @@ export default function (state = initialState, action) {
return {
...state,
isPinCodeReqiure: true,
pinCodeNavigation: action.payload || {},
};
case CLOSE_PIN_CODE_MODAL:
return {

View File

@ -93,7 +93,6 @@ class DraftsContainer extends Component {
.then((res) => {
const { schedules } = this.state;
const newSchedules = [...schedules].filter(schedule => schedule._id !== id);
console.log(res);
this.setState({ schedules: this._sortData(newSchedules, true) });
})

View File

@ -47,7 +47,7 @@ class LoginContainer extends PureComponent {
// Component Functions
_handleOnPressLogin = (username, password) => {
const { dispatch, setPinCodeState, intl } = this.props;
const { dispatch, intl } = this.props;
this.setState({ isLoading: true });
@ -56,8 +56,7 @@ class LoginContainer extends PureComponent {
if (result) {
dispatch(updateCurrentAccount({ ...result }));
dispatch(addOtherAccount({ username: result.name }));
dispatch(openPinCodeModal());
setPinCodeState({ navigateTo: ROUTES.DRAWER.MAIN });
dispatch(openPinCodeModal({ navigateTo: ROUTES.DRAWER.MAIN }));
dispatch(loginAction(true));
userActivity(result.name, 20);
this._setPushToken(result.name);
@ -119,7 +118,7 @@ class LoginContainer extends PureComponent {
render() {
const { isLoading } = this.state;
const { navigation, setPinCodeState } = this.props;
const { navigation } = this.props;
return (
<LoginScreen
handleOnPressLogin={this._handleOnPressLogin}
@ -127,7 +126,6 @@ class LoginContainer extends PureComponent {
handleSignUp={this._handleSignUp}
isLoading={isLoading}
navigation={navigation}
setPinCodeState={setPinCodeState}
/>
);
}

View File

@ -63,7 +63,6 @@ class LoginScreen extends PureComponent {
const {
navigation,
intl,
setPinCodeState,
handleOnPressLogin,
handleSignUp,
isLoading,
@ -199,7 +198,6 @@ class LoginScreen extends PureComponent {
>
<SteemConnect
handleOnModalClose={this._handleOnModalToggle}
setPinCodeState={setPinCodeState}
/>
</Modal>
</View>

View File

@ -80,7 +80,7 @@ class PinCodeContainer extends Component {
_resetPinCode = pin => new Promise((resolve, reject) => {
const {
currentAccount, dispatch, accessToken, navigateTo, navigateParams, navigation, intl,
currentAccount, dispatch, pinCodeParams: { navigateTo, navigateParams, accessToken }, navigation, intl,
} = this.props;
const { isOldPinVerified, oldPinCode } = this.state;
@ -135,7 +135,7 @@ class PinCodeContainer extends Component {
_setFirstPinCode = pin => new Promise((resolve) => {
const {
currentAccount, dispatch, accessToken, navigateTo, navigateParams, navigation,
currentAccount, dispatch, pinCodeParams: { navigateTo, navigateParams, accessToken }, navigation,
} = this.props;
const pinData = {
@ -165,7 +165,7 @@ class PinCodeContainer extends Component {
_verifyPinCode = pin => new Promise((resolve, reject) => {
const {
currentAccount, dispatch, accessToken, navigateTo, navigateParams, navigation, intl,
currentAccount, dispatch, pinCodeParams: { navigateTo, navigateParams, accessToken }, navigation, intl,
} = this.props;
// If the user is exist, we are just checking to pin and navigating to home screen
@ -184,7 +184,6 @@ class PinCodeContainer extends Component {
[_currentAccount.local] = realmData;
dispatch(updateCurrentAccount({ ..._currentAccount }));
dispatch(closePinCodeModal());
console.log('navigateParams :', navigateParams);
if (navigateTo) {
navigation.navigate(navigateTo, navigateParams);
}
@ -311,7 +310,7 @@ class PinCodeContainer extends Component {
};
render() {
const { currentAccount, intl, isReset } = this.props;
const { currentAccount, intl, pinCodeParams: { isReset } } = this.props;
const { informationText, isExistUser } = this.state;
return (
@ -332,6 +331,7 @@ const mapStateToProps = state => ({
currentAccount: state.account.currentAccount,
applicationPinCode: state.account.pin,
otherAccounts: state.account.otherAccounts,
pinCodeParams: state.application.pinCodeNavigation,
});
export default injectIntl(connect(mapStateToProps)(PinCodeContainer));

View File

@ -352,7 +352,7 @@ class ProfileContainer extends Component {
username,
} = this.state;
const {
isDarkTheme, isLoggedIn, currency, navigation, setPinCodeState,
isDarkTheme, isLoggedIn, currency, navigation,
} = this.props;
const activePage = (navigation.state.params && navigation.state.params.activePage) || 0;
@ -382,7 +382,6 @@ class ProfileContainer extends Component {
selectedQuickProfile={selectedQuickProfile}
selectedUser={user}
username={username}
setPinCodeState={setPinCodeState}
/>
);
}

View File

@ -84,7 +84,6 @@ class ProfileScreen extends PureComponent {
selectedUser,
username,
activePage,
setPinCodeState,
} = this.props;
const {
@ -250,7 +249,6 @@ class ProfileScreen extends PureComponent {
<Wallet
setEstimatedWalletValue={this._setEstimatedWalletValue}
selectedUser={selectedUser}
setPinCodeState={setPinCodeState}
/>
) : (
<WalletDetailsPlaceHolder />

View File

@ -24,7 +24,6 @@ const RootContainer = () => (WrappedComponent) => {
constructor(props) {
super(props);
this.state = {
pinCodeStates: null,
wrappedComponentStates: null,
appState: AppState.currentState,
};
@ -157,10 +156,6 @@ const RootContainer = () => (WrappedComponent) => {
}, 1 * 60 * 1000);
};
_setPinCodeState = async (data) => {
return this.setState({ pinCodeStates: { ...data } });
};
_setWrappedComponentState = (data) => {
this.setState({ wrappedComponentStates: { ...data } });
};
@ -203,7 +198,7 @@ const RootContainer = () => (WrappedComponent) => {
render() {
const { isPinCodeReqiure, navigation } = this.props;
const { pinCodeStates, wrappedComponentStates } = this.state;
const { wrappedComponentStates } = this.state;
return (
<Fragment>
@ -214,7 +209,6 @@ const RootContainer = () => (WrappedComponent) => {
backButtonClose={false}
>
<PinCode
{...pinCodeStates}
setWrappedComponentState={this._setWrappedComponentState}
navigation={navigation}
/>
@ -222,7 +216,6 @@ const RootContainer = () => (WrappedComponent) => {
<WrappedComponent
{...this.props}
{...wrappedComponentStates}
setPinCodeState={this._setPinCodeState}
/>
{Platform.OS === 'android' && <PostButtonForAndroid />}
</Fragment>

View File

@ -205,11 +205,10 @@ class SettingsContainer extends Component {
};
_handleButtonPress = (actionType) => {
const { dispatch, setPinCodeState } = this.props;
const { dispatch } = this.props;
switch (actionType) {
case 'pincode':
setPinCodeState({ isReset: true });
dispatch(openPinCodeModal());
dispatch(openPinCodeModal({ isReset: true }));
break;
case 'feedback':

View File

@ -24,7 +24,7 @@ class SteemConnect extends PureComponent {
_onNavigationStateChange = (event) => {
let code;
const {
dispatch, setPinCodeState, handleOnModalClose, intl,
dispatch, handleOnModalClose, intl,
} = this.props;
const { isLoading } = this.state;
if (event.url.indexOf('?code=') > -1) {
@ -44,9 +44,7 @@ class SteemConnect extends PureComponent {
dispatch(updateCurrentAccount({ ...result }));
dispatch(addOtherAccount({ username: result.name }));
dispatch(loginAction(true));
dispatch(openPinCodeModal());
// TODO: return accesstoken
setPinCodeState({ accessToken: result.accessToken, navigateTo: ROUTES.DRAWER.MAIN });
dispatch(openPinCodeModal({ accessToken: result.accessToken, navigateTo: ROUTES.DRAWER.MAIN }));
} else {
// TODO: Error alert (Toast Message)
}