Add support for wallets without getOwner() interface (#3779)

* Make Wallet Mist compatible #3282

* Owners icons on load

* Fix oversized logo on load

* Don't fetch registry twice (even when pending)

* Better logging...

* Better contract view : show if no events // show loading events

* Better decimal typed input

* PR grumble
This commit is contained in:
Nicolas Gotchac
2016-12-10 01:26:28 +01:00
committed by Jaco Greeff
parent 923f85d90d
commit 6655e7e3c0
15 changed files with 228 additions and 74 deletions

View File

@@ -40,7 +40,7 @@ import styles from './contract.css';
class Contract extends Component {
static contextTypes = {
api: React.PropTypes.object.isRequired
}
};
static propTypes = {
setVisibleAccounts: PropTypes.func.isRequired,
@@ -50,7 +50,7 @@ class Contract extends Component {
contracts: PropTypes.object,
isTest: PropTypes.bool,
params: PropTypes.object
}
};
state = {
contract: null,
@@ -64,8 +64,9 @@ class Contract extends Component {
allEvents: [],
minedEvents: [],
pendingEvents: [],
queryValues: {}
}
queryValues: {},
loadingEvents: true
};
componentDidMount () {
const { api } = this.context;
@@ -115,7 +116,7 @@ class Contract extends Component {
render () {
const { balances, contracts, params, isTest } = this.props;
const { allEvents, contract, queryValues } = this.state;
const { allEvents, contract, queryValues, loadingEvents } = this.state;
const account = contracts[params.address];
const balance = balances[params.address];
@@ -134,12 +135,17 @@ class Contract extends Component {
account={ account }
balance={ balance }
/>
<Queries
contract={ contract }
values={ queryValues } />
values={ queryValues }
/>
<Events
isTest={ isTest }
events={ allEvents } />
isLoading={ loadingEvents }
events={ allEvents }
/>
{ this.renderDetails(account) }
</Page>
@@ -358,6 +364,10 @@ class Contract extends Component {
}
_receiveEvents = (error, logs) => {
if (this.state.loadingEvents) {
this.setState({ loadingEvents: false });
}
if (error) {
console.error('_receiveEvents', error);
return;