Sort within recursive neighbor enumeration

Test plan: Open the cred explorer, and use the + sign to expand the
neighbors. Observe that those neighbors are now sorted by cred.

Paired with @wchargin
This commit is contained in:
Dandelion Mané 2018-05-10 16:31:43 -07:00
parent 121b83717f
commit 8a4b9592b1
1 changed files with 6 additions and 0 deletions

View File

@ -199,6 +199,12 @@ class RecursiveTable extends React.Component<RTProps, RTState> {
});
return neighborMap
.getAll()
.sort((a, b) => {
const x = pagerankResult.get(a.address).probability;
const y = pagerankResult.get(b.address).probability;
return x - y;
})
.reverse()
.map(({address}) => (
<RecursiveTable
depth={depth + 1}