Smarter balance fetching (#3605)
* Smarter dApps Manifest fetching... * Fetching only visible accounts (and don't delete other balances) #3590 * Moved balances action into BalancesActions #3590 * Fetch balances for accounts and contracts #3590 * Add balances to contract/address/account views #3590 * Fix transaction not fetching on first load * Remove console.warn * Fix pending tokens not showing #3154 * Fix tokens image update * Remove unused name in Header * Separate Tokens and ETH fetching #3590 * Remove unused isTest * Fetch Tokens Balance via Filter #3590 * Fix linting * Fix updating tokens image (#3590) * Fix contract balances * Improved Status * Fixing secureApi issues... * Fetch all tokens every 2 minutes (for safety) #3590 * PR changes fix * Fix Account error
This commit is contained in:
committed by
Jaco Greeff
parent
9fdab84305
commit
08c507daaa
@@ -28,20 +28,7 @@ export default class Header extends Component {
|
||||
|
||||
static propTypes = {
|
||||
account: PropTypes.object,
|
||||
balance: PropTypes.object,
|
||||
isTest: PropTypes.bool
|
||||
}
|
||||
|
||||
state = {
|
||||
name: null
|
||||
}
|
||||
|
||||
componentWillMount () {
|
||||
this.setName();
|
||||
}
|
||||
|
||||
componentWillReceiveProps () {
|
||||
this.setName();
|
||||
balance: PropTypes.object
|
||||
}
|
||||
|
||||
render () {
|
||||
@@ -87,13 +74,13 @@ export default class Header extends Component {
|
||||
}
|
||||
|
||||
renderTxCount () {
|
||||
const { isTest, balance } = this.props;
|
||||
const { balance } = this.props;
|
||||
|
||||
if (!balance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const txCount = balance.txCount.sub(isTest ? 0x100000 : 0);
|
||||
const { txCount } = balance;
|
||||
|
||||
return (
|
||||
<div className={ styles.infoline }>
|
||||
@@ -101,28 +88,4 @@ export default class Header extends Component {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
onSubmitName = (name) => {
|
||||
const { api } = this.context;
|
||||
const { account } = this.props;
|
||||
|
||||
this.setState({ name }, () => {
|
||||
api.parity
|
||||
.setAccountName(account.address, name)
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setName () {
|
||||
const { account } = this.props;
|
||||
|
||||
if (account && account.name !== this.propName) {
|
||||
this.propName = account.name;
|
||||
this.setState({
|
||||
name: account.name
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user