Fix mention notifications

This commit is contained in:
Jonathan Staab 2023-05-12 05:56:18 -07:00
parent faaac70c1a
commit 02bfdc517f
4 changed files with 14 additions and 10 deletions

View File

@ -1,8 +1,8 @@
# Current
- [ ] Mentions don't show up in notifications
- [ ] Fix relay recommendations
- [ ] Preview note1
- [ ] Open embedded pubkeys and stuff in modals
- [ ] Handle embedded naddrs http://localhost:5173/nevent1qqs0sp3dvtvd9t8glg8l4t4lhamvk4092mnqqtcklylwn50l0fxh75qpzemhxue69uhhyetvv9ujumn0wd68ytnzv9hxgcv4y0g
- [ ] Add curated relay list, and an easy way to view content on the relays
- [ ] Pagination is slow. Maybe load with no window first, then add since?
- [ ] Add coupon code registration for relay
- [ ] Repurpose chat as groups
@ -13,6 +13,8 @@
# Core
- [ ] Make mutes private
- [ ] Add welcome.nostr.wine relay to onboarding
- http://localhost:5173/nevent1qqsp9vf7agqyl7swhwepjw0r9s8ny55vsxkljh62pn0uh6f2g9z7a2qpr3mhxue69uhkummnw3ezuarjw43kketwvf6kx6mn9e3k7mgpyfmhxue69uhkummnw3ez6an9wf5kv6t9vsh8wetvd3hhyer9wghxuet5nds9yj
- [ ] Write multi-relay pagination into paravel and open source it
- https://github.com/nostr-protocol/nips/pull/408
- nevent1qqszpjf3307ccam3cl957yc7k3h5c7vpt7gz2vdzgwkqszsyvdj6e0cpzfmhxue69uhk7enxvd5xz6tw9ec82csgdxq30

View File

@ -83,8 +83,10 @@
const isStandalone = i => {
return (
(!content[i - 1] || content[i - 1].type === "newline") &&
(!content[i + 1] || content[i + 1].type === "newline")
!content[i - 1] ||
content[i - 1].type === "newline" ||
!content[i + 1] ||
content[i + 1].type === "newline"
)
}

View File

@ -8,7 +8,7 @@
import Popover from "src/partials/Popover.svelte"
import NoteContent from "src/app/shared/NoteContent.svelte"
import NotificationSection from "src/app/views/NotificationSection.svelte"
import {getPersonWithFallback, userEvents} from "src/agent/db"
import {getPersonWithFallback} from "src/agent/db"
import {modal} from "src/partials/state"
export let event
@ -22,7 +22,7 @@
)
const notifications = modifyZaps(event.notifications)
const note = event.ref ? userEvents.get(event.ref) : notifications[0]
const note = event.ref || notifications[0]
const timestamp = pluck("created_at", notifications).reduce(max, 0)
const replies = notifications.filter(propEq("kind", 1))
const likes = notifications.filter(propEq("kind", 7))

View File

@ -39,16 +39,16 @@
// Group notifications so we're only showing the parent once per chunk
$: events = $notifications
.slice(0, limit)
.map(e => [e, findReplyId(e)])
.map(e => [e, userEvents.get(findReplyId(e))])
.filter(([e, ref]) => {
if (userEvents.get(ref)?.kind !== 1) {
if (ref && ref.kind !== 1) {
return false
}
if (activeTab === tabs[0]) {
return [1].includes(e.kind)
} else {
return [7, 9735].includes(e.kind)
return [7, 9735].includes(e.kind) && ref
}
})
.reduce((r, [e, ref]) => {