Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fix peers not displaying #3561

Merged
merged 2 commits into from
Nov 21, 2016
Merged

Fix peers not displaying #3561

merged 2 commits into from
Nov 21, 2016

Conversation

ngotchac
Copy link
Contributor

Fixes #3558

@ngotchac ngotchac added A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update). M7-ui labels Nov 21, 2016

if (refreshStatus) {
statusPromises.push(this._api.eth.hashrate());
statusPromises.push(this._api.parity.netPeers());
}

Promise
.all(statusPromises)
.then((statusResults) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use Array destructuring here and then check for existence:

([ syncing, netPeers ]) => {
  if (syncing && netPeers) {
    
  }
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed here with @derhuerst - put the optional ones at the back, check for undefined if you must (then not adding it), but just cleaner.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 5db8591 on ng-fix-peers into ** on master**.

@ngotchac ngotchac added A0-pleasereview 🤓 Pull request needs code review. and removed A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update). labels Nov 21, 2016
@derhuerst derhuerst added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Nov 21, 2016
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1d26648 on ng-fix-peers into ** on master**.

@jacogr jacogr merged commit 8a1b585 into master Nov 21, 2016
@ngotchac ngotchac deleted the ng-fix-peers branch November 21, 2016 23:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants