Merge pull request #320 from oxen-io/sort-sn-staked-list
Sorts the "MY STAKES" service node list alphabetically
This commit is contained in:
commit
fbc06a407b
|
@ -72,13 +72,20 @@ export default {
|
||||||
node.contributors.find(
|
node.contributors.find(
|
||||||
c => c.address === this.our_address && c.amount > 0
|
c => c.address === this.our_address && c.amount > 0
|
||||||
);
|
);
|
||||||
return nodes.filter(getOurContribution).map(n => {
|
return nodes
|
||||||
const ourContribution = getOurContribution(n);
|
.filter(getOurContribution)
|
||||||
return {
|
.sort((a, b) => {
|
||||||
...n,
|
if (a.service_node_pubkey < b.service_node_pubkey) return -1;
|
||||||
ourContributionAmount: ourContribution.amount
|
if (a.service_node_pubkey > b.service_node_pubkey) return 1;
|
||||||
};
|
return 0;
|
||||||
});
|
})
|
||||||
|
.map(n => {
|
||||||
|
const ourContribution = getOurContribution(n);
|
||||||
|
return {
|
||||||
|
...n,
|
||||||
|
ourContributionAmount: ourContribution.amount
|
||||||
|
};
|
||||||
|
});
|
||||||
},
|
},
|
||||||
fetching: state => state.gateway.daemon.service_nodes.fetching
|
fetching: state => state.gateway.daemon.service_nodes.fetching
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue