mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-07-17 15:52:22 +02:00
fix stream top zappers amount
This commit is contained in:
@ -18,7 +18,7 @@ export default function GoalTopZappers({
|
|||||||
|
|
||||||
const totals = zaps?.reduce<Record<string, number>>((dir, z) => {
|
const totals = zaps?.reduce<Record<string, number>>((dir, z) => {
|
||||||
const sender = getZapSender(z);
|
const sender = getZapSender(z);
|
||||||
dir[sender] = dir[sender] + (getZapPayment(z)?.amount ?? 0);
|
dir[sender] = (dir[sender] ?? 0) + (getZapPayment(z)?.amount ?? 0);
|
||||||
return dir;
|
return dir;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
|
@ -9,13 +9,13 @@ import useStreamChatTimeline from "../stream/stream-chat/use-stream-chat-timelin
|
|||||||
import { ParsedStream } from "../../../helpers/nostr/stream";
|
import { ParsedStream } from "../../../helpers/nostr/stream";
|
||||||
import UserAvatarLink from "../../../components/user/user-avatar-link";
|
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 { timeline } = useStreamChatTimeline(stream);
|
||||||
const zaps = timeline.filter((e) => e.kind === kinds.Zap);
|
const zaps = timeline.filter((e) => e.kind === kinds.Zap);
|
||||||
|
|
||||||
const totals = zaps?.reduce<Record<string, number>>((dir, z) => {
|
const totals = zaps?.reduce<Record<string, number>>((dir, z) => {
|
||||||
const sender = getZapSender(z);
|
const sender = getZapSender(z);
|
||||||
dir[sender] = dir[sender] + (getZapPayment(z)?.amount ?? 0);
|
dir[sender] = (dir[sender] ?? 0) + (getZapPayment(z)?.amount ?? 0);
|
||||||
return dir;
|
return dir;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
@ -35,7 +35,7 @@ import { UserEmojiProvider } from "../../../providers/global/emoji-provider";
|
|||||||
import StreamStatusBadge from "../components/status-badge";
|
import StreamStatusBadge from "../components/status-badge";
|
||||||
import ChatMessageForm from "./stream-chat/stream-chat-form";
|
import ChatMessageForm from "./stream-chat/stream-chat-form";
|
||||||
import StreamChatLog from "./stream-chat/chat-log";
|
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 StreamHashtags from "../components/stream-hashtags";
|
||||||
import StreamZapButton from "../components/stream-zap-button";
|
import StreamZapButton from "../components/stream-zap-button";
|
||||||
import StreamGoal from "../components/stream-goal";
|
import StreamGoal from "../components/stream-goal";
|
||||||
@ -185,7 +185,7 @@ function MobileStreamPage({ stream }: { stream: ParsedStream }) {
|
|||||||
Stream Chat
|
Stream Chat
|
||||||
</DrawerHeader>
|
</DrawerHeader>
|
||||||
<DrawerBody p={0} overflow="hidden" display="flex" gap="2" flexDirection="column">
|
<DrawerBody p={0} overflow="hidden" display="flex" gap="2" flexDirection="column">
|
||||||
<TopZappers stream={stream} px="2" />
|
<StreamTopZappers stream={stream} px="2" />
|
||||||
<StreamChatLog stream={stream} flex={1} px="2" />
|
<StreamChatLog stream={stream} flex={1} px="2" />
|
||||||
<ChatMessageForm stream={stream} />
|
<ChatMessageForm stream={stream} />
|
||||||
</DrawerBody>
|
</DrawerBody>
|
||||||
|
@ -5,7 +5,7 @@ import { ParsedStream } from "../../../../helpers/nostr/stream";
|
|||||||
import { LightboxProvider } from "../../../../components/lightbox-provider";
|
import { LightboxProvider } from "../../../../components/lightbox-provider";
|
||||||
import IntersectionObserverProvider from "../../../../providers/local/intersection-observer";
|
import IntersectionObserverProvider from "../../../../providers/local/intersection-observer";
|
||||||
import { useTimelineCurserIntersectionCallback } from "../../../../hooks/use-timeline-cursor-intersection-callback";
|
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 ChatMessageForm from "./stream-chat-form";
|
||||||
import useStreamChatTimeline from "./use-stream-chat-timeline";
|
import useStreamChatTimeline from "./use-stream-chat-timeline";
|
||||||
import StreamChatLog from "./chat-log";
|
import StreamChatLog from "./chat-log";
|
||||||
@ -37,7 +37,7 @@ export default function StreamChat({
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
)}
|
)}
|
||||||
<CardBody display="flex" flexDirection="column" overflow="hidden" p={0}>
|
<CardBody display="flex" flexDirection="column" overflow="hidden" p={0}>
|
||||||
<TopZappers stream={stream} py="2" px="4" pt={!isPopup ? 0 : undefined} />
|
<StreamTopZappers stream={stream} py="2" px="4" pt={!isPopup ? 0 : undefined} />
|
||||||
<StreamChatLog ref={scrollBox} stream={stream} flex={1} px="4" py="2" mb="2" />
|
<StreamChatLog ref={scrollBox} stream={stream} flex={1} px="4" py="2" mb="2" />
|
||||||
{!isChatLog && <ChatMessageForm stream={stream} />}
|
{!isChatLog && <ChatMessageForm stream={stream} />}
|
||||||
</CardBody>
|
</CardBody>
|
||||||
|
Reference in New Issue
Block a user