diff --git a/.changeset/tidy-trains-tap.md b/.changeset/tidy-trains-tap.md new file mode 100644 index 000000000..6cb5bab61 --- /dev/null +++ b/.changeset/tidy-trains-tap.md @@ -0,0 +1,5 @@ +--- +"nostrudel": patch +--- + +Fix subscription id too long diff --git a/src/views/home/discover-tab.tsx b/src/views/home/discover-tab.tsx index 5c054031d..e3b3747c2 100644 --- a/src/views/home/discover-tab.tsx +++ b/src/views/home/discover-tab.tsx @@ -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 } diff --git a/src/views/home/following-tab.tsx b/src/views/home/following-tab.tsx index 4294f9943..5eda3874b 100644 --- a/src/views/home/following-tab.tsx +++ b/src/views/home/following-tab.tsx @@ -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 }