This commit is contained in:
Nicolas Gotchac 2017-05-05 10:00:31 +02:00 committed by Jaco Greeff
parent eb316fcb9c
commit d4dc58eafe
2 changed files with 10 additions and 3 deletions

View File

@ -128,7 +128,8 @@ export default class CertificationsMiddleware {
return badgeReg.getContract()
.then((badgeRegContract) => {
logs = badgeRegContract.parseEventLogs(logs);
const ids = logs.map((log) => log.params.id.value.toNumber());
const ids = logs.map((log) => log.params && log.params.id.value.toNumber());
return fetchCertifiers(uniq(ids));
});

View File

@ -101,8 +101,14 @@ class Contract extends Component {
const { api } = this.context;
const { subscriptionId, blockSubscriptionId, contract } = this.state;
api.unsubscribe(blockSubscriptionId);
contract.unsubscribe(subscriptionId);
if (blockSubscriptionId >= 0) {
api.unsubscribe(blockSubscriptionId);
}
if (subscriptionId >= 0) {
contract.unsubscribe(subscriptionId);
}
this.props.setVisibleAccounts([]);
}