Merge branch 'lf/neg-notifications'

This commit is contained in:
Liam Fitzgerald 2021-02-24 14:07:45 +10:00
commit 491c1b4698
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
2 changed files with 20 additions and 4 deletions

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

View File

@ -233,8 +233,8 @@ function updateNotificationStats(state: HarkState, index: NotifIndex, statField:
const curr = _.get(state.unreads.graph, [index.graph.graph, index.graph.index, statField], 0);
_.set(state.unreads.graph, [index.graph.graph, index.graph.index, statField], f(curr));
} else if('group' in index) {
const curr = _.get(state.unreads.group, [index.group.group, statField], 0);
_.set(state.unreads.group, [index.group.group, statField], f(curr));
const curr = _.get(state.unreads.group, [index.group, statField], 0);
_.set(state.unreads.group, [index.group, statField], f(curr));
}
}