mirror of
https://github.com/urbit/shrub.git
synced 2024-12-25 04:52:06 +03:00
hark: lazier notifications, update in add-graph
This commit is contained in:
parent
7ae79cfb1a
commit
69c555c4b5
@ -159,7 +159,7 @@
|
||||
[cards this]
|
||||
==
|
||||
++ add-graph
|
||||
|= [rid=resource =graph:graph-store]
|
||||
|= rid=resource
|
||||
^- (quip card _state)
|
||||
=/ group-rid=(unit resource)
|
||||
(group-from-app-resource:met %graph rid)
|
||||
@ -172,14 +172,20 @@
|
||||
|(is-hidden &(watch-on-self =(our.bowl entity.rid)))
|
||||
?. should-watch
|
||||
`state
|
||||
:- (give:ha ~[/updates] %listen [rid ~])
|
||||
state(watching (~(put in watching) [rid ~]))
|
||||
=/ graph=graph:graph-store :: graph in subscription is bunted
|
||||
(get-graph-mop:gra rid)
|
||||
=/ node=(unit node:graph-store)
|
||||
(bind (peek:orm:graph-store graph) |=([@ =node:graph-store] node))
|
||||
=^ cards state
|
||||
(check-nodes (drop node) rid)
|
||||
:_ state(watching (~(put in watching) [rid ~]))
|
||||
(weld cards (give:ha ~[/updates] %listen [rid ~]))
|
||||
::
|
||||
++ graph-update
|
||||
|= =update:graph-store
|
||||
^- (quip card _state)
|
||||
?: ?=(%add-graph -.q.update)
|
||||
(add-graph resource.q.update graph.q.update)
|
||||
(add-graph resource.q.update)
|
||||
?. ?=(%add-nodes -.q.update)
|
||||
[~ state]
|
||||
=* rid resource.q.update
|
||||
|
@ -198,15 +198,8 @@
|
||||
^- update:store
|
||||
:- %more
|
||||
^- (list update:store)
|
||||
:+ give-unreads
|
||||
[%set-dnd dnd]
|
||||
%+ weld
|
||||
%+ turn
|
||||
(tap-nonempty:ha archive)
|
||||
(timebox-update &)
|
||||
%+ turn
|
||||
(tap-nonempty:ha notifications)
|
||||
(timebox-update |)
|
||||
:- give-unreads
|
||||
[%set-dnd dnd]~
|
||||
::
|
||||
++ give-since-unreads
|
||||
^- (list [stats-index:store stats:store])
|
||||
@ -234,12 +227,6 @@
|
||||
^- update:store
|
||||
:- %unreads
|
||||
(weld give-each-unreads give-since-unreads)
|
||||
::
|
||||
++ timebox-update
|
||||
|= archived=?
|
||||
|= [time=@da =timebox:store]
|
||||
^- update:store
|
||||
[%timebox time archived ~(tap by timebox)]
|
||||
--
|
||||
::
|
||||
++ on-peek
|
||||
|
@ -17,6 +17,15 @@
|
||||
%+ scry-for update:store
|
||||
/graph/(scot %p entity.res)/[name.res]
|
||||
::
|
||||
++ get-graph-mop
|
||||
|= res=resource
|
||||
^- graph:store
|
||||
=/ =update:store
|
||||
(get-graph res)
|
||||
?> ?=(%0 -.res)
|
||||
?> ?=(%add-graph -.q.update)
|
||||
graph.q.update
|
||||
::
|
||||
++ gut-younger-node-siblings
|
||||
|= [res=resource =index:store]
|
||||
^- (map index:store node:store)
|
||||
|
Loading…
Reference in New Issue
Block a user