diff --git a/src/views/goals/components/goal-top-zappers.tsx b/src/views/goals/components/goal-top-zappers.tsx index 2fee41323..9ada2334e 100644 --- a/src/views/goals/components/goal-top-zappers.tsx +++ b/src/views/goals/components/goal-top-zappers.tsx @@ -18,7 +18,7 @@ export default function GoalTopZappers({ const totals = zaps?.reduce>((dir, z) => { const sender = getZapSender(z); - dir[sender] = dir[sender] + (getZapPayment(z)?.amount ?? 0); + dir[sender] = (dir[sender] ?? 0) + (getZapPayment(z)?.amount ?? 0); return dir; }, {}); diff --git a/src/views/streams/components/top-zappers.tsx b/src/views/streams/components/stream-top-zappers.tsx similarity index 89% rename from src/views/streams/components/top-zappers.tsx rename to src/views/streams/components/stream-top-zappers.tsx index cfb2aa521..ca48f6824 100644 --- a/src/views/streams/components/top-zappers.tsx +++ b/src/views/streams/components/stream-top-zappers.tsx @@ -9,13 +9,13 @@ import useStreamChatTimeline from "../stream/stream-chat/use-stream-chat-timelin import { ParsedStream } from "../../../helpers/nostr/stream"; import UserAvatarLink from "../../../components/user/user-avatar-link"; -export default function TopZappers({ stream, ...props }: FlexProps & { stream: ParsedStream }) { +export default function StreamTopZappers({ stream, ...props }: FlexProps & { stream: ParsedStream }) { const { timeline } = useStreamChatTimeline(stream); const zaps = timeline.filter((e) => e.kind === kinds.Zap); const totals = zaps?.reduce>((dir, z) => { const sender = getZapSender(z); - dir[sender] = dir[sender] + (getZapPayment(z)?.amount ?? 0); + dir[sender] = (dir[sender] ?? 0) + (getZapPayment(z)?.amount ?? 0); return dir; }, {}); diff --git a/src/views/streams/stream/index.tsx b/src/views/streams/stream/index.tsx index a2c02064e..1866bbde7 100644 --- a/src/views/streams/stream/index.tsx +++ b/src/views/streams/stream/index.tsx @@ -35,7 +35,7 @@ import { UserEmojiProvider } from "../../../providers/global/emoji-provider"; import StreamStatusBadge from "../components/status-badge"; import ChatMessageForm from "./stream-chat/stream-chat-form"; import StreamChatLog from "./stream-chat/chat-log"; -import TopZappers from "../components/top-zappers"; +import StreamTopZappers from "../components/stream-top-zappers"; import StreamHashtags from "../components/stream-hashtags"; import StreamZapButton from "../components/stream-zap-button"; import StreamGoal from "../components/stream-goal"; @@ -185,7 +185,7 @@ function MobileStreamPage({ stream }: { stream: ParsedStream }) { Stream Chat - + diff --git a/src/views/streams/stream/stream-chat/index.tsx b/src/views/streams/stream/stream-chat/index.tsx index 36e1d0dc0..beecc62c9 100644 --- a/src/views/streams/stream/stream-chat/index.tsx +++ b/src/views/streams/stream/stream-chat/index.tsx @@ -5,7 +5,7 @@ import { ParsedStream } from "../../../../helpers/nostr/stream"; import { LightboxProvider } from "../../../../components/lightbox-provider"; import IntersectionObserverProvider from "../../../../providers/local/intersection-observer"; import { useTimelineCurserIntersectionCallback } from "../../../../hooks/use-timeline-cursor-intersection-callback"; -import TopZappers from "../../components/top-zappers"; +import StreamTopZappers from "../../components/stream-top-zappers"; import ChatMessageForm from "./stream-chat-form"; import useStreamChatTimeline from "./use-stream-chat-timeline"; import StreamChatLog from "./chat-log"; @@ -37,7 +37,7 @@ export default function StreamChat({ )} - + {!isChatLog && }