Skip to content

Commit

Permalink
Add hints to notification parents, fix address bug on note actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Staab committed Oct 30, 2024
1 parent b08f4ad commit 0e81643
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/shared/NoteActions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
isSignedEvent,
createEvent,
getAddress,
getAddressTagValues,
getContextTagValues,
getPubkeyTagValues,
} from "@welshman/util"
import {tweened} from "svelte/motion"
Expand Down Expand Up @@ -77,7 +77,7 @@
export let zapper
const signedEvent = asSignedEvent(note as any)
const address = contextAddress || first(getAddressTagValues(note.tags))
const address = contextAddress || first(getContextTagValues(note.tags))
const addresses = [address].filter(identity)
const nevent = nip19.neventEncode({
id: note.id,
Expand Down
6 changes: 5 additions & 1 deletion src/app/views/NotificationReplies.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {pluck} from "ramda"
import {uniq} from "@welshman/lib"
import {pubkey} from "@welshman/app"
import {isShareableRelayUrl} from "@welshman/util"
import {formatTimestamp} from "src/util/misc"
import Spinner from "src/partials/Spinner.svelte"
import PeopleAction from "src/app/shared/PeopleAction.svelte"
Expand All @@ -12,7 +13,10 @@
export let notification: Notification
const {root, interactions, timestamp} = notification
const event = deriveEvent(root)
const relays = uniq(interactions.flatMap(e =>
e.tags.flatMap(t => t.slice(2).filter(isShareableRelayUrl)),
))
const event = deriveEvent(root, {relays})
$: actionText = $event?.pubkey === $pubkey ? "replied to your note" : "mentioned you"
</script>
Expand Down

0 comments on commit 0e81643

Please sign in to comment.