Fix subscription id too long

This commit is contained in:
hzrd149 2023-05-05 07:47:01 -05:00
parent 7fea7e0fbf
commit 0df1db85ae
3 changed files with 9 additions and 4 deletions

View File

@ -0,0 +1,5 @@
---
"nostrudel": patch
---
Fix subscription id too long

View File

@ -3,7 +3,7 @@ import { Button, Flex, Spinner } from "@chakra-ui/react";
import moment from "moment";
import { Note } from "../../components/note";
import { useTimelineLoader } from "../../hooks/use-timeline-loader";
import { isReply } from "../../helpers/nostr-event";
import { isReply, truncatedId } from "../../helpers/nostr-event";
import { useAppTitle } from "../../hooks/use-app-title";
import { useReadRelayUrls } from "../../hooks/use-client-relays";
import { useCurrentAccount } from "../../hooks/use-current-account";
@ -69,7 +69,7 @@ export default function DiscoverTab() {
const throttledPubkeys = useThrottle(pubkeys, 1000);
const { events, loading, loadMore } = useTimelineLoader(
`${account.pubkey}-discover`,
`${truncatedId(account.pubkey)}-discover`,
relays,
{ authors: throttledPubkeys, kinds: [1], since: moment().subtract(1, "hour").unix() },
{ pageSize: moment.duration(1, "hour").asSeconds(), enabled: throttledPubkeys.length > 0 }

View File

@ -2,7 +2,7 @@ import { Button, Flex, FormControl, FormLabel, Spinner, Switch } from "@chakra-u
import { useSearchParams } from "react-router-dom";
import moment from "moment";
import { Note } from "../../components/note";
import { isReply } from "../../helpers/nostr-event";
import { isReply, truncatedId } from "../../helpers/nostr-event";
import { useTimelineLoader } from "../../hooks/use-timeline-loader";
import { useUserContacts } from "../../hooks/use-user-contacts";
import { AddIcon } from "@chakra-ui/icons";
@ -25,7 +25,7 @@ export default function FollowingTab() {
const following = contacts?.contacts || [];
const { events, loading, loadMore } = useTimelineLoader(
`${account.pubkey}-following-posts`,
`${truncatedId(account.pubkey)}-following-posts`,
readRelays,
{ authors: following, kinds: [1, 6], since: moment().subtract(2, "hour").unix() },
{ pageSize: moment.duration(2, "hour").asSeconds(), enabled: following.length > 0 }