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

Commit

Permalink
feat: handle mapmarker errors, empty leader tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnygleason committed Oct 15, 2019
1 parent f5eb1a2 commit 8a56a17
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const StatCards = () => {
<Tooltip
classes={{tooltip: classes.tooltip}}
placement="top"
title={globalStats['!entLastLeader']}
title={globalStats['!entLastLeader'] || ''}
>
<Link
className={classes.leader}
Expand Down
29 changes: 19 additions & 10 deletions src/v2/stores/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,25 @@ class Store {
});

get mapMarkers() {
return compose(
map(({nodePubkey: pubkey, tpu: gossip, coordinates, identity}) => ({
pubkey,
gossip,
coordinates,
name: (identity && identity.name) || identity.pubkey,
avatarUrl: (identity && identity.avatarUrl) || '',
})),
filter({what: 'Validator'}),
)(this.network);
if (!this.network || !this.network.length) {
return [];
}

try {
return compose(
map(({nodePubkey: pubkey, tpu: gossip, coordinates, identity}) => ({
pubkey,
gossip,
coordinates,
name: (identity && identity.name) || identity.pubkey,
avatarUrl: (identity && identity.avatarUrl) || '',
})),
filter({what: 'Validator'}),
)(this.network);
} catch (e) {
console.error('mapMarkers()', e);
return [];
}
}

get validators() {
Expand Down

0 comments on commit 8a56a17

Please sign in to comment.