mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-29 08:21:20 +00:00
Fix grouping mention notifications
This commit is contained in:
parent
2fa274ffee
commit
b8707359ca
@ -54,15 +54,14 @@ export const groupNotifications = $notifications => {
|
||||
|
||||
// Group notifications by event
|
||||
for (const ix of $notifications) {
|
||||
const eventId = findReplyId(ix)
|
||||
const event = $userEvents.get(eventId)
|
||||
const event = $userEvents.get(findReplyId(ix))
|
||||
|
||||
if (reactionKinds.includes(ix.kind) && !event) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Group and sort by day/event so we can group clustered reactions to the same event
|
||||
const key = formatTimestampAsLocalISODate(ix.created_at).slice(0, 11) + (eventId || ix.id)
|
||||
const key = formatTimestampAsLocalISODate(ix.created_at).slice(0, 11) + (event?.id || ix.id)
|
||||
|
||||
groups[key] = groups[key] || {key, event, interactions: []}
|
||||
groups[key].interactions.push(convertZap(ix))
|
||||
|
@ -43,8 +43,11 @@ export const displayRelay = ({url}: Relay) => last(url.split("://"))
|
||||
|
||||
export const getRelaySearch = $relays => fuzzy($relays, {keys: ["url", "name", "description"]})
|
||||
|
||||
export const getSearchableRelays = $relays => {
|
||||
const urls = pluck('url', $relays.filter(r => (r.info?.supported_nips || []).includes(50)))
|
||||
export const getSearchableRelays = ($relays: Relay[]) => {
|
||||
const urls = pluck(
|
||||
"url",
|
||||
$relays.filter(r => (r.info?.supported_nips || []).includes(50))
|
||||
)
|
||||
|
||||
return uniq(env.get().SEARCH_RELAYS.concat(urls)).slice(0, 8) as string[]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user