From 8aff5aaf3a8a0aeb8ea972ba84d6236f097804b3 Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Sat, 1 Jul 2023 18:59:42 +0200 Subject: [PATCH 1/4] fix: fetch all streams --- src/hooks/profile.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/hooks/profile.ts b/src/hooks/profile.ts index fabd01a..85198c6 100644 --- a/src/hooks/profile.ts +++ b/src/hooks/profile.ts @@ -1,7 +1,6 @@ import { useMemo } from "react"; import { RequestBuilder, - ReplaceableNoteStore, FlatNoteStore, NostrLink, EventKind, @@ -24,20 +23,18 @@ export function useProfile(link: NostrLink, leaveOpen = false) { return b; }, [link, leaveOpen]); - const { data: streamsData } = useRequestBuilder( + const { data: streamsData } = useRequestBuilder( System, - ReplaceableNoteStore, + FlatNoteStore, sub ); - - const streams = Array.isArray(streamsData) - ? streamsData - : streamsData - ? [streamsData] - : []; + const streams = streamsData ?? []; const addresses = useMemo(() => { - return streams.map((e) => `${e.kind}:${e.pubkey}:${findTag(e, "d")}`); + if (streamsData) { + return streamsData.map((e) => `${e.kind}:${e.pubkey}:${findTag(e, "d")}`); + } + return []; }, [streamsData]); const zapsSub = useMemo(() => { From 49683c8cbd6e7aa8052927ee79a865064daefca8 Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Sat, 1 Jul 2023 19:15:51 +0200 Subject: [PATCH 2/4] fix: use right store --- src/hooks/profile.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/hooks/profile.ts b/src/hooks/profile.ts index 85198c6..1d62d44 100644 --- a/src/hooks/profile.ts +++ b/src/hooks/profile.ts @@ -2,6 +2,7 @@ import { useMemo } from "react"; import { RequestBuilder, FlatNoteStore, + ParameterizedReplaceableNoteStore, NostrLink, EventKind, parseZap, @@ -23,11 +24,12 @@ export function useProfile(link: NostrLink, leaveOpen = false) { return b; }, [link, leaveOpen]); - const { data: streamsData } = useRequestBuilder( - System, - FlatNoteStore, - sub - ); + const { data: streamsData } = + useRequestBuilder( + System, + ParameterizedReplaceableNoteStore, + sub + ); const streams = streamsData ?? []; const addresses = useMemo(() => { From c733c4066ae050ac330ed80aa44416ec90ced2b5 Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Sat, 1 Jul 2023 19:16:45 +0200 Subject: [PATCH 3/4] fix: fixed width profile after tablet resolution --- src/pages/profile-page.css | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/profile-page.css b/src/pages/profile-page.css index 29966a1..c7750bb 100644 --- a/src/pages/profile-page.css +++ b/src/pages/profile-page.css @@ -3,8 +3,11 @@ justify-content: center; } -.profile-page .profile-container { - max-width: 620px; + +@media (min-width: 768px) { + .profile-page .profile-container { + width: 620px; + } } .profile-page .profile-content { From 9747b71f8a1f8a0d073f34181b8b7a7a7132ef31 Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Sat, 1 Jul 2023 19:17:48 +0200 Subject: [PATCH 4/4] fix: use findTag --- src/pages/profile-page.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/profile-page.tsx b/src/pages/profile-page.tsx index 6594f63..a629ecb 100644 --- a/src/pages/profile-page.tsx +++ b/src/pages/profile-page.tsx @@ -69,8 +69,7 @@ export function ProfilePage() { function goToLive() { if (liveEvent) { - const d = - liveEvent.tags?.find((t: string[]) => t?.at(0) === "d")?.at(1) || ""; + const d = findTag(liveEvent, "d") || ""; const naddr = encodeTLV( NostrPrefix.Address, d,