Merge pull request #102 from Permissionless-Software-Foundation/fix/tokenBug

fix(tokens): Tokens appear when they aren't really there
This commit is contained in:
Chris Troutner
2020-11-17 16:50:32 -08:00
committed by GitHub
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -34,7 +34,7 @@ class Tokens extends React.Component {
icon='fa-redo'
type='primary'
className='btn-md ml-1 mt-1 mb-1'
onClick={_this.handleGetTokens}
onClick={() => _this.handleGetTokens(true)}
/>
{_this.state.txId &&
<div className='txIdContainer'>
@@ -69,7 +69,7 @@ class Tokens extends React.Component {
? _this.state.selectedTokenToSend
: {}
}
handleSend={_this.onHandleGetTokens}
handleSend={() => _this.onHandleGetTokens(true)}
setTxId={_this.setTxId}
/>
)}
@@ -158,14 +158,15 @@ class Tokens extends React.Component {
tokens = await bchWallet.listTokens()
}
if (!tokens.length) {
throw new Error('No tokens found on this wallet.')
}
_this.setState({
tokens,
inFetch: false
})
if (!tokens.length) {
throw new Error('No tokens found on this wallet.')
}
_this.props.setTokensInfo(tokens)
} catch (error) {
_this.handleError(error)
@@ -218,7 +218,7 @@ class SendTokens extends React.Component {
_this.resetValues()
setTimeout(() => {
_this.props.handleSend(true)
_this.props.handleSend()
_this.props.handleBack()
}, 3000)
} catch (error) {