mirror of
https://github.com/urbit/shrub.git
synced 2025-01-01 17:16:47 +03:00
graph-store: sort graph with most recent at left of graph (gth)
This commit is contained in:
parent
8707816d25
commit
f1b10f2a07
@ -28,7 +28,7 @@
|
||||
rose+(ot style+(ot mid+sa open+sa close+sa ~) lines+(ar dank) ~)
|
||||
==
|
||||
::
|
||||
++ orm ((or-map atom node) lth)
|
||||
++ orm ((or-map atom node) gth)
|
||||
++ orm-log ((or-map time action) lth)
|
||||
::
|
||||
++ enjs
|
||||
@ -252,7 +252,7 @@
|
||||
++ graph
|
||||
|= a=json
|
||||
^- ^graph
|
||||
=/ or-mp ((or-map atom ^node) lth)
|
||||
=/ or-mp ((or-map atom ^node) gth)
|
||||
%+ gas:or-mp ~
|
||||
%+ turn ~(tap by ((om node) a))
|
||||
|* [b=cord c=*]
|
||||
|
@ -20,7 +20,7 @@
|
||||
::
|
||||
+$ action-log ((mop time action) lth)
|
||||
::
|
||||
+$ graph ((mop atom node) lth)
|
||||
+$ graph ((mop atom node) gth)
|
||||
::
|
||||
+$ internal-graph
|
||||
$~ [%empty ~]
|
||||
|
@ -34,7 +34,9 @@ export class PostList extends Component {
|
||||
|
||||
paginatedNodes() {
|
||||
const { props, state } = this;
|
||||
let nodes = Array.from(props.graph).reverse();
|
||||
let nodes = Array.from(props.graph).sort((a,b) => {
|
||||
return b[0] - a[0];
|
||||
});
|
||||
|
||||
return {
|
||||
nodes: nodes.slice(
|
||||
|
@ -123,7 +123,6 @@ export default class GraphReducer {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: recursive add node
|
||||
_addNode(graph, index, node) {
|
||||
console.log(index, node);
|
||||
// set child of graph
|
||||
|
Loading…
Reference in New Issue
Block a user