diff --git a/src/app/components/ReactionSummary.svelte b/src/app/components/ReactionSummary.svelte index 9d88180c..812dc3d8 100644 --- a/src/app/components/ReactionSummary.svelte +++ b/src/app/components/ReactionSummary.svelte @@ -33,6 +33,7 @@ url?: string reactionClass?: string noTooltip?: boolean + innerEvent?: TrustedEvent children?: Snippet } @@ -43,23 +44,36 @@ url = "", reactionClass = "", noTooltip = false, + innerEvent = undefined, children, }: Props = $props() + const eventIds = innerEvent ? [event.id, innerEvent.id] : [event.id] + const reports = deriveArray( deriveEventsById({repository, filters: [{kinds: [REPORT], "#e": [event.id]}]}), ) const reactions = deriveArray( - deriveEventsById({repository, filters: [{kinds: [REACTION], "#e": [event.id]}]}), + deriveEventsById({repository, filters: [{kinds: [REACTION], "#e": eventIds}]}), ) const zaps = deriveArray( deriveItemsByKey({ repository, getKey: zap => zap.response.id, - filters: [{kinds: [ZAP_RESPONSE], "#e": [event.id]}], - eventToItem: (response: TrustedEvent) => getValidZap(response, event), + filters: [{kinds: [ZAP_RESPONSE], "#e": eventIds}], + eventToItem: (response: TrustedEvent) => { + const zap = getValidZap(response, event) + + if (zap) { + return zap + } + + if (innerEvent) { + return getValidZap(response, innerEvent) + } + }, }), ) diff --git a/src/app/components/RoomItem.svelte b/src/app/components/RoomItem.svelte index 2eec2531..1cf4623c 100644 --- a/src/app/components/RoomItem.svelte +++ b/src/app/components/RoomItem.svelte @@ -1,8 +1,16 @@