Merge pull request #320 from oxen-io/sort-sn-staked-list

Sorts the "MY STAKES" service node list alphabetically
This commit is contained in:
Sean 2022-08-23 07:17:45 +10:00 committed by GitHub
commit fbc06a407b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 7 deletions

View File

@ -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
}), }),