fix: chat zaps
This commit is contained in:
parent
a465c99579
commit
4d77882114
@ -10,7 +10,7 @@
|
|||||||
"@snort/system": "^1.2.12",
|
"@snort/system": "^1.2.12",
|
||||||
"@snort/system-react": "^1.2.12",
|
"@snort/system-react": "^1.2.12",
|
||||||
"@snort/system-wasm": "^1.0.2",
|
"@snort/system-wasm": "^1.0.2",
|
||||||
"@snort/worker-relay": "^1.0.8",
|
"@snort/worker-relay": "^1.0.9",
|
||||||
"@sqlite.org/sqlite-wasm": "^3.45.1-build1",
|
"@sqlite.org/sqlite-wasm": "^3.45.1-build1",
|
||||||
"@szhsin/react-menu": "^4.0.2",
|
"@szhsin/react-menu": "^4.0.2",
|
||||||
"@types/webscopeio__react-textarea-autocomplete": "^4.7.2",
|
"@types/webscopeio__react-textarea-autocomplete": "^4.7.2",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { SnortContext, useEventReactions, useUserProfile } from "@snort/system-react";
|
import { SnortContext, useEventReactions, useReactions, useUserProfile } from "@snort/system-react";
|
||||||
import { EventKind, NostrLink, TaggedNostrEvent } from "@snort/system";
|
import { EventKind, NostrLink, TaggedNostrEvent } from "@snort/system";
|
||||||
import React, { Suspense, lazy, useContext, useMemo, useRef, useState } from "react";
|
import React, { Suspense, lazy, useContext, useMemo, useRef, useState } from "react";
|
||||||
import { useHover, useIntersectionObserver, useOnClickOutside } from "usehooks-ts";
|
import { useHover, useIntersectionObserver, useOnClickOutside } from "usehooks-ts";
|
||||||
@ -33,13 +33,11 @@ function emojifyReaction(reaction: string) {
|
|||||||
export function ChatMessage({
|
export function ChatMessage({
|
||||||
streamer,
|
streamer,
|
||||||
ev,
|
ev,
|
||||||
related,
|
|
||||||
emojiPacks,
|
emojiPacks,
|
||||||
badges,
|
badges,
|
||||||
}: {
|
}: {
|
||||||
ev: TaggedNostrEvent;
|
ev: TaggedNostrEvent;
|
||||||
streamer: string;
|
streamer: string;
|
||||||
related: ReadonlyArray<TaggedNostrEvent>;
|
|
||||||
emojiPacks: EmojiPack[];
|
emojiPacks: EmojiPack[];
|
||||||
badges: Badge[];
|
badges: Badge[];
|
||||||
}) {
|
}) {
|
||||||
@ -58,6 +56,7 @@ export function ChatMessage({
|
|||||||
const profile = useUserProfile(inView?.isIntersecting ? ev.pubkey : undefined);
|
const profile = useUserProfile(inView?.isIntersecting ? ev.pubkey : undefined);
|
||||||
const shouldShowMuteButton = ev.pubkey !== streamer && ev.pubkey !== login?.pubkey;
|
const shouldShowMuteButton = ev.pubkey !== streamer && ev.pubkey !== login?.pubkey;
|
||||||
const zapTarget = profile?.lud16 ?? profile?.lud06;
|
const zapTarget = profile?.lud16 ?? profile?.lud06;
|
||||||
|
const related = useReactions("reactions", [link], undefined, true);
|
||||||
const { zaps, reactions } = useEventReactions(link, related);
|
const { zaps, reactions } = useEventReactions(link, related);
|
||||||
const emojiNames = emojiPacks.map(p => p.emojis).flat();
|
const emojiNames = emojiPacks.map(p => p.emojis).flat();
|
||||||
|
|
||||||
|
@ -172,7 +172,6 @@ export function LiveChat({
|
|||||||
streamer={host}
|
streamer={host}
|
||||||
ev={a}
|
ev={a}
|
||||||
key={a.id}
|
key={a.id}
|
||||||
related={feed}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
10
yarn.lock
10
yarn.lock
@ -2460,14 +2460,14 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@snort/worker-relay@npm:^1.0.8":
|
"@snort/worker-relay@npm:^1.0.9":
|
||||||
version: 1.0.8
|
version: 1.0.9
|
||||||
resolution: "@snort/worker-relay@npm:1.0.8"
|
resolution: "@snort/worker-relay@npm:1.0.9"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@sqlite.org/sqlite-wasm": ^3.45.1-build1
|
"@sqlite.org/sqlite-wasm": ^3.45.1-build1
|
||||||
eventemitter3: ^5.0.1
|
eventemitter3: ^5.0.1
|
||||||
uuid: ^9.0.1
|
uuid: ^9.0.1
|
||||||
checksum: 5e99396754634575069aee135cecb94a29eb2b77637daa48ac7a08ea3c5ef5f3e35374b7eff8623bc0bf7f1aab55b177492c7a0ac7cf8f003bb21131391b37e0
|
checksum: a66723f963da980c54eab1bb9001ca07b19001ac0ad7780df41a1eacacb1a317cb66ffb0bfdadfa46f033f1811821a763ee13b329245dfcde0988ef7e0d7e541
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -7123,7 +7123,7 @@ __metadata:
|
|||||||
"@snort/system": ^1.2.12
|
"@snort/system": ^1.2.12
|
||||||
"@snort/system-react": ^1.2.12
|
"@snort/system-react": ^1.2.12
|
||||||
"@snort/system-wasm": ^1.0.2
|
"@snort/system-wasm": ^1.0.2
|
||||||
"@snort/worker-relay": ^1.0.8
|
"@snort/worker-relay": ^1.0.9
|
||||||
"@sqlite.org/sqlite-wasm": ^3.45.1-build1
|
"@sqlite.org/sqlite-wasm": ^3.45.1-build1
|
||||||
"@szhsin/react-menu": ^4.0.2
|
"@szhsin/react-menu": ^4.0.2
|
||||||
"@testing-library/dom": ^9.3.1
|
"@testing-library/dom": ^9.3.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user