mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-02 20:15:27 +03:00
hark: new boxing refinement
This commit is contained in:
parent
55ad8e22ae
commit
4babfb22b7
@ -260,16 +260,14 @@
|
||||
^- update:store
|
||||
:- %more
|
||||
^- (list update:store)
|
||||
:+ give-unreads
|
||||
[%set-dnd dnd]
|
||||
give-notifications
|
||||
:~ give-unreads
|
||||
[%set-dnd dnd]
|
||||
give-notifications
|
||||
==
|
||||
::
|
||||
++ give-notifications
|
||||
^- (list update:store)
|
||||
%+ turn ~(tap by unread-notes)
|
||||
|= [=index:store =notification:store]
|
||||
^- update:store
|
||||
[%added index notification]
|
||||
[%timebox ~ ~(tap by unread-notes)]
|
||||
::
|
||||
++ give-since-unreads
|
||||
^- (list [stats-index:store stats:store])
|
||||
@ -322,8 +320,7 @@
|
||||
?:(is-archive archive notifications)
|
||||
|= [time=@da =timebox:store]
|
||||
^- update:store
|
||||
:^ %timebox time is-archive
|
||||
~(tap by timebox)
|
||||
[%timebox `time ~(tap by timebox)]
|
||||
==
|
||||
::
|
||||
++ on-poke
|
||||
@ -550,7 +547,7 @@
|
||||
=. unreads-count (~(put by unreads-count) stats-index 0)
|
||||
=/ times=(list index:store)
|
||||
(unread-for-stats-index stats-index)
|
||||
=? timeboxes !(~(has by timeboxes) stats-index) ~& 'new box' (~(put by timeboxes) stats-index now.bowl)
|
||||
=? timeboxes !(~(has by timeboxes) stats-index) (~(put by timeboxes) stats-index now.bowl)
|
||||
(give:(read-indices times) %read-count stats-index)
|
||||
::
|
||||
++ read-indices
|
||||
|
@ -502,11 +502,10 @@
|
||||
==
|
||||
::
|
||||
++ timebox
|
||||
|= [tim=@da arch=? l=(list [^index ^notification])]
|
||||
|= [tim=(unit @da) l=(list [^index ^notification])]
|
||||
^- json
|
||||
%- pairs
|
||||
:~ time+s+(scot %ud tim)
|
||||
archive+b+arch
|
||||
:~ time+`json`?~(tim ~ s+(scot %ud u.tim))
|
||||
:- %notifications
|
||||
^- json
|
||||
:- %a
|
||||
|
@ -31,11 +31,12 @@
|
||||
::
|
||||
+$ action
|
||||
$% [%add-note =index =notification]
|
||||
[%archive time=(unit @da) index]
|
||||
:: if .time is ~, then archiving unread notification
|
||||
:: else, archiving read notification
|
||||
[%archive time=(unit @da) =index]
|
||||
::
|
||||
[%unread-count =stats-index =time]
|
||||
[%read-count =stats-index]
|
||||
::
|
||||
::
|
||||
[%unread-each =stats-index ref=index:graph-store time=@da]
|
||||
[%read-each =stats-index ref=index:graph-store]
|
||||
@ -71,7 +72,7 @@
|
||||
[%more more=(list update)]
|
||||
[%added =index =notification]
|
||||
[%note-read =time =index]
|
||||
[%timebox time=@da archived=? =(list [index notification])]
|
||||
[%timebox time=(unit @da) =(list [index notification])]
|
||||
[%count count=@ud]
|
||||
[%clear =stats-index]
|
||||
[%unreads unreads=(list [stats-index stats])]
|
||||
|
Loading…
Reference in New Issue
Block a user