hark-store: do not give all notifications in +on-watch
[%count unread-count]
%+ weld
%+ turn
- (tap-nonempty archive)
+ %+ scag 5
+ (tap-nonempty:ha archive)
(timebox-update &)
%+ turn
- (tap-nonempty notifications)
+ %+ scag 5
+ (tap-nonempty:ha notifications)
(timebox-update |)
::
++ timebox-update
|= [time=@da =timebox:store]
^- update:store
[%timebox time archived ~(tap by timebox)]
- ::
- ++ tap-nonempty
- |= =notifications:store
- ^- (list [@da timebox:store])
- %+ skip (tap:orm notifications)
- |=([@da =timebox:store] =(0 ~(wyt by timebox)))
--
::
++ on-peek
(slav %ud i.t.t.path)
=/ length=@ud
(slav %ud i.t.t.t.path)
- :^ ~ ~ %noun
+ :^ ~ ~ %hark-update
!> ^- update:store
:- %more
%+ turn
- (scag length (slag offset (tap:orm notifications)))
+ %+ scag length
+ %+ slag offset
+ (tap-nonempty:ha notifications)
|= [time=@da =timebox:store]
^- update:store
:^ %timebox time %.n
|_ =bowl:gall
+* met ~(. metadata bowl)
::
+++ tap-nonempty
+ |= =notifications:store
+ ^- (list [@da timebox:store])
+ %+ skip (tap:orm notifications)
+ |=([@da =timebox:store] =(0 ~(wyt by timebox)))
+::
++ merge-notification
|= [existing=notification:store new=notification:store]
^- notification:store
