hark-store: give stats facts for group notifications

Group notifications were being left out of the initial %unreads fact,
which was causing faulty calculation of notification counts  on the
frontend

Fixes urbit/landscape #276
This commit is contained in:
Liam Fitzgerald 2021-02-22 10:47:38 +10:00
parent fab9a47a92
commit ac2c335bd2
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -279,7 +279,6 @@
%+ turn
~(tap by unreads-count)
|= [=stats-index:store count=@ud]
?> ?=(%graph -.stats-index)
:* stats-index
~(wyt in (~(gut by by-index) stats-index ~))
[%count count]
@ -297,10 +296,27 @@
(~(gut by last-seen) stats-index *time)
==
::
++ give-group-unreads
^- (list [stats-index:store stats:store])
%+ murn ~(tap by by-index)
|= [=stats-index:store nots=(set [time index:store])]
?. ?=(%group -.stats-index)
~
:- ~
:* stats-index
~(wyt in nots)
[%count 0]
*time
==
::
++ give-unreads
^- update:store
:- %unreads
(weld give-each-unreads give-since-unreads)
;: weld
give-each-unreads
give-since-unreads
give-group-unreads
==
--
::
++ on-peek