diff --git a/src/components/transaction/view/transactionView.js b/src/components/transaction/view/transactionView.js index 1477b45ff..53e038946 100644 --- a/src/components/transaction/view/transactionView.js +++ b/src/components/transaction/view/transactionView.js @@ -52,6 +52,8 @@ class TransactionView extends PureComponent { {transactions && transactions.map((item, index) => { const transactionData = groomingTransactionData(item, steemPerMVests, formatNumber); + if (transactionData.length === 0) return null; + const value = transactionData.value.split(' '); return ( diff --git a/src/components/walletDetails/container/walletDetailsContainer.js b/src/components/walletDetails/container/walletDetailsContainer.js index aadf1b692..6e2b2286f 100644 --- a/src/components/walletDetails/container/walletDetailsContainer.js +++ b/src/components/walletDetails/container/walletDetailsContainer.js @@ -26,16 +26,21 @@ class WalletContainer extends PureComponent { // Component Life Cycle Functions // Component Functions - _navigate = () => { - const { dispatch, setPinCodeState, navigation } = this.props; + _navigate = (a,b) => { + const { dispatch, setPinCodeState } = this.props; - navigation.navigate(ROUTES.SCREENS.TRANSFER, { - transferType: 'transferToSaving', - fundType: 'STEEM', + // navigation.navigate(ROUTES.SCREENS.TRANSFER, { + // transferType: 'withdrawToSaving', + // fundType: 'STEEM', + // }); + + console.log('a,b :', a,b); + + setPinCodeState({ + navigateTo: ROUTES.SCREENS.TRANSFER, + navigateParams: { transferType: 'transferToken', fundType: 'STEEM' }, }); - - // setPinCodeState({ navigateTo: ROUTES.SCREENS.TRANSFER, navigateParams: {transferType: 'sbd'} }); - // dispatch(openPinCodeModal()); + dispatch(openPinCodeModal()); }; render() { diff --git a/src/components/walletDetails/view/walletDetailsView.js b/src/components/walletDetails/view/walletDetailsView.js index 41b2f63d1..5419be898 100644 --- a/src/components/walletDetails/view/walletDetailsView.js +++ b/src/components/walletDetails/view/walletDetailsView.js @@ -40,7 +40,7 @@ class WalletDetailsView extends PureComponent { isBoldText dropdown dropdownOptions={['Transfer']} - onDropdownSelect={test => navigate()} + onDropdownSelect={(a,b) => navigate(a,b)} /> { if (key) { const privateKey = PrivateKey.fromString(key); - const args = [ + + const args = [[ 'transfer_to_savings', { from: data.from, @@ -552,9 +553,7 @@ export const transferToSavings = (currentAccount, pin, data) => { amount: data.amount, memo: data.memo, }, - ]; - - console.log('args :', args); + ]]; return new Promise((resolve, reject) => { client.broadcast @@ -577,7 +576,7 @@ export const transferFromSavings = (currentAccount, pin, data) => { if (key) { const privateKey = PrivateKey.fromString(key); - const args = [ + const args = [[ 'transfer_from_savings', { from: data.from, @@ -586,7 +585,7 @@ export const transferFromSavings = (currentAccount, pin, data) => { memo: data.memo, request_id: data.requestId, }, - ]; + ]]; return new Promise((resolve, reject) => { client.broadcast @@ -609,14 +608,14 @@ export const transferToVesting = (currentAccount, pin, data) => { if (key) { const privateKey = PrivateKey.fromString(key); - const args = [ + const args = [[ 'transfer_to_vesting', { from: data.from, to: data.destination, amount: data.amount, }, - ]; + ]]; return new Promise((resolve, reject) => { client.broadcast diff --git a/src/screens/pinCode/container/pinCodeContainer.js b/src/screens/pinCode/container/pinCodeContainer.js index e8275a3fb..54455662e 100644 --- a/src/screens/pinCode/container/pinCodeContainer.js +++ b/src/screens/pinCode/container/pinCodeContainer.js @@ -80,7 +80,7 @@ class PinCodeContainer extends Component { _resetPinCode = pin => new Promise((resolve, reject) => { const { - currentAccount, dispatch, accessToken, navigateTo, navigation, intl, + currentAccount, dispatch, accessToken, navigateTo, navigateParams, navigation, intl, } = this.props; const { isOldPinVerified, oldPinCode } = this.state; @@ -102,7 +102,7 @@ class PinCodeContainer extends Component { dispatch(closePinCodeModal()); if (navigateTo) { - navigation.navigate(navigateTo); + navigation.navigate(navigateTo, navigateParams); } resolve(); }); @@ -135,7 +135,7 @@ class PinCodeContainer extends Component { _setFirstPinCode = pin => new Promise((resolve) => { const { - currentAccount, dispatch, accessToken, navigateTo, navigation, + currentAccount, dispatch, accessToken, navigateTo, navigateParams, navigation, } = this.props; const pinData = { @@ -155,7 +155,7 @@ class PinCodeContainer extends Component { this._savePinCode(pin); dispatch(closePinCodeModal()); if (navigateTo) { - navigation.navigate(navigateTo); + navigation.navigate(navigateTo, navigateParams); } resolve(); }); @@ -165,7 +165,7 @@ class PinCodeContainer extends Component { _verifyPinCode = pin => new Promise((resolve, reject) => { const { - currentAccount, dispatch, accessToken, navigateTo, navigation, intl, + currentAccount, dispatch, accessToken, navigateTo, navigateParams, navigation, intl, } = this.props; // If the user is exist, we are just checking to pin and navigating to home screen @@ -184,8 +184,9 @@ class PinCodeContainer extends Component { [_currentAccount.local] = realmData; dispatch(updateCurrentAccount({ ..._currentAccount })); dispatch(closePinCodeModal()); + console.log('navigateParams :', navigateParams); if (navigateTo) { - navigation.navigate(navigateTo); + navigation.navigate(navigateTo, navigateParams); } }) .catch((err) => { diff --git a/src/screens/transfer/container/transferContainer.js b/src/screens/transfer/container/transferContainer.js index 9012d1e72..17323e093 100644 --- a/src/screens/transfer/container/transferContainer.js +++ b/src/screens/transfer/container/transferContainer.js @@ -55,15 +55,14 @@ class ExampleContainer extends Component { amount, memo, }; + data.amount = `${data.amount} ${fundType}`; switch (transferType) { case 'transferToken': func = transferToken; - data.amount = `${data.amount} ${fundType}`; break; case 'transferToSaving': func = transferToSavings; - data.amount = `${data.amount} ${fundType}`; break; case 'powerUp': func = transferToVesting; @@ -71,22 +70,18 @@ class ExampleContainer extends Component { case 'withdrawToSaving': func = transferFromSavings; data.requestId = new Date().getTime() >>> 0; - data.amount = `${data.amount} ${fundType}`; break; default: break; } - console.log('func :', func); return func(currentAccount, pinCode, data) - .then((res) => { - console.log('res :', res); + .then(() => { dispatch(toastNotification('Successfull')); navigation.goBack(); }) .catch((err) => { - console.log('err :', err); dispatch(toastNotification(err.message)); }); }; diff --git a/src/utils/wallet.js b/src/utils/wallet.js index 47db62ee0..2cee327cd 100644 --- a/src/utils/wallet.js +++ b/src/utils/wallet.js @@ -95,7 +95,7 @@ export const groomingTransactionData = (transaction, steemPerMVests, formatNumbe result.icon = 'reorder'; break; default: - break; + return []; } return result; };