From 790abbe0cf9d83eed1031595a8b0f02473f52452 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Tue, 25 Jun 2019 19:09:30 +0300 Subject: [PATCH] Fixed withdraw issues --- .../transfer/container/transferContainer.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/screens/transfer/container/transferContainer.js b/src/screens/transfer/container/transferContainer.js index 4140a9ce5..22abda3be 100644 --- a/src/screens/transfer/container/transferContainer.js +++ b/src/screens/transfer/container/transferContainer.js @@ -29,7 +29,9 @@ import TransferView from '../screen/transferScreen'; class TransferContainer extends Component { constructor(props) { super(props); - this.state = {}; + this.state = { + fundType: props.navigation.getParam('fundType', ''), + }; } // Component Life Cycle Functions @@ -45,7 +47,7 @@ class TransferContainer extends Component { fetchBalance = username => { const { navigation } = this.props; - const fundType = navigation.getParam('fundType', ''); + const { fundType } = this.state; getAccount(username).then(account => { let balance; @@ -59,6 +61,14 @@ class TransferContainer extends Component { case 'POINT': balance = navigation.getParam('balance', ''); break; + case 'SAVING_STEEM': + this.setState({ fundType: 'STEEM' }); + balance = account[0].savings_balance.replace(' STEEM', ''); + break; + case 'SAVING_SBD': + this.setState({ fundType: 'STEEM DOLLAR' }); + balance = account[0].savings_sbd_balance.replace(' SBD', ''); + break; default: break; } @@ -131,9 +141,8 @@ class TransferContainer extends Component { render() { const { accounts, currentAccount, navigation } = this.props; - const { balance } = this.state; + const { balance, fundType } = this.state; - const fundType = navigation.getParam('fundType', ''); const transferType = navigation.getParam('transferType', ''); return (