diff --git a/bun.lockb b/bun.lockb index 3d96f4db..78029912 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/app/notifications/index.tsx b/src/app/notifications/index.tsx index 1221e866..155dfa91 100644 --- a/src/app/notifications/index.tsx +++ b/src/app/notifications/index.tsx @@ -60,7 +60,7 @@ export function NotificationScreen() {

Loading

- ) : activities.length < 1 ? ( + ) : activities.length <= 1 ? (

🎉

diff --git a/src/shared/accounts/more.tsx b/src/shared/accounts/more.tsx index 55f1be55..a86f4b00 100644 --- a/src/shared/accounts/more.tsx +++ b/src/shared/accounts/more.tsx @@ -19,7 +19,7 @@ export function AccountMoreActions({ pubkey }: { pubkey: string }) { - + - + @@ -56,18 +75,22 @@ export function NoteRepost({ id, pubkey }: { id: string; pubkey: string }) { action.

-
+
-
diff --git a/src/shared/notes/actions/zap.tsx b/src/shared/notes/actions/zap.tsx index a1a025f9..e1d02e9f 100644 --- a/src/shared/notes/actions/zap.tsx +++ b/src/shared/notes/actions/zap.tsx @@ -19,8 +19,8 @@ import { compactNumber } from '@utils/number'; export function NoteZap({ id, pubkey }: { id: string; pubkey: string }) { const { createZap } = useNostr(); - const { data: event } = useEvent(id); const { user } = useProfile(pubkey); + const { data: event } = useEvent(id); const [amount, setAmount] = useState('21'); const [zapMessage, setZapMessage] = useState(''); diff --git a/src/shared/notes/kinds/repost.tsx b/src/shared/notes/kinds/repost.tsx index 5fc3a9cb..413e4308 100644 --- a/src/shared/notes/kinds/repost.tsx +++ b/src/shared/notes/kinds/repost.tsx @@ -17,9 +17,9 @@ import { User } from '@shared/user'; import { useEvent } from '@utils/hooks/useEvent'; -export function Repost({ event }: { event: NDKEvent }) { - // @ts-expect-error, root_id isn't exist on NDKEvent - const { status, data } = useEvent(event.root_id ?? event.id, event.content); +export function Repost({ event, root }: { event: NDKEvent; root?: string }) { + const rootPost = root ?? event.tags.find((el) => el[0] === 'e')?.[1]; + const { status, data } = useEvent(rootPost, event.content); const renderKind = useCallback( (repostEvent: NDKEvent) => { diff --git a/src/shared/notes/users/repost.tsx b/src/shared/notes/users/repost.tsx index bad40363..8f329bf2 100644 --- a/src/shared/notes/users/repost.tsx +++ b/src/shared/notes/users/repost.tsx @@ -18,7 +18,7 @@ export function RepostUser({ pubkey }: { pubkey: string }) { className="relative z-20 inline-block h-6 w-6 rounded bg-white ring-1 ring-black" />
-
+
{user?.name || user?.display_name || shortenKey(pubkey)}
reposted diff --git a/src/shared/user.tsx b/src/shared/user.tsx index 11587379..fe8c3b4b 100644 --- a/src/shared/user.tsx +++ b/src/shared/user.tsx @@ -88,7 +88,7 @@ export function User({
@@ -115,7 +115,7 @@ export function User({ )}
-

+

{user?.about}

@@ -124,13 +124,13 @@ export function User({
View profile Message diff --git a/src/shared/widgets/global/articles.tsx b/src/shared/widgets/global/articles.tsx index 23f65129..c12f530e 100644 --- a/src/shared/widgets/global/articles.tsx +++ b/src/shared/widgets/global/articles.tsx @@ -13,7 +13,7 @@ import { Widget } from '@utils/types'; export function GlobalArticlesWidget({ params }: { params: Widget }) { const { ndk } = useNDK(); const { status, data } = useQuery( - ['global-articles-widget'], + [params.id + '-' + params.title], async () => { const events = await ndk.fetchEvents({ kinds: [NDKKind.Article], diff --git a/src/shared/widgets/global/files.tsx b/src/shared/widgets/global/files.tsx index 95781208..d82857b7 100644 --- a/src/shared/widgets/global/files.tsx +++ b/src/shared/widgets/global/files.tsx @@ -13,7 +13,7 @@ import { Widget } from '@utils/types'; export function GlobalFilesWidget({ params }: { params: Widget }) { const { ndk } = useNDK(); const { status, data } = useQuery( - ['global-files-widget'], + [params.id + '-' + params.title], async () => { const events = await ndk.fetchEvents({ // @ts-expect-error, NDK not support file metadata yet diff --git a/src/shared/widgets/global/hashtag.tsx b/src/shared/widgets/global/hashtag.tsx index 13693946..7833c377 100644 --- a/src/shared/widgets/global/hashtag.tsx +++ b/src/shared/widgets/global/hashtag.tsx @@ -22,7 +22,7 @@ import { Widget } from '@utils/types'; export function GlobalHashtagWidget({ params }: { params: Widget }) { const { ndk } = useNDK(); const { status, data } = useQuery( - ['global-hashtag-widget', params.content], + [params.id + '-' + params.title], async () => { const events = await ndk.fetchEvents({ kinds: [NDKKind.Text, NDKKind.Repost, NDKKind.Article], diff --git a/src/shared/widgets/local/articles.tsx b/src/shared/widgets/local/articles.tsx index 5b94ab9c..11fecff0 100644 --- a/src/shared/widgets/local/articles.tsx +++ b/src/shared/widgets/local/articles.tsx @@ -15,7 +15,7 @@ export function LocalArticlesWidget({ params }: { params: Widget }) { const { db } = useStorage(); const { status, data, hasNextPage, isFetchingNextPage, fetchNextPage } = useInfiniteQuery({ - queryKey: ['local-articles-widget'], + queryKey: [params.id + '-' + params.title], queryFn: async ({ pageParam = 0 }) => { return await db.getAllEventsByKinds([NDKKind.Article], 20, pageParam); }, diff --git a/src/shared/widgets/local/feeds.tsx b/src/shared/widgets/local/feeds.tsx index fcd29983..26c1e09f 100644 --- a/src/shared/widgets/local/feeds.tsx +++ b/src/shared/widgets/local/feeds.tsx @@ -23,7 +23,7 @@ export function LocalFeedsWidget({ params }: { params: Widget }) { const { db } = useStorage(); const { status, data, hasNextPage, isFetchingNextPage, fetchNextPage } = useInfiniteQuery({ - queryKey: ['local-feeds-widget', params.content], + queryKey: [params.id + '-' + params.title], queryFn: async ({ pageParam = 0 }) => { const authors = JSON.parse(params.content); return await db.getAllEventsByAuthors(authors, 20, pageParam); @@ -71,7 +71,7 @@ export function LocalFeedsWidget({ params }: { params: Widget }) { data-index={index} ref={virtualizer.measureElement} > - +
); case 1063: diff --git a/src/shared/widgets/local/files.tsx b/src/shared/widgets/local/files.tsx index a3fe4fd7..ec5f3ced 100644 --- a/src/shared/widgets/local/files.tsx +++ b/src/shared/widgets/local/files.tsx @@ -15,7 +15,7 @@ export function LocalFilesWidget({ params }: { params: Widget }) { const { db } = useStorage(); const { status, data, hasNextPage, isFetchingNextPage, fetchNextPage } = useInfiniteQuery({ - queryKey: ['local-files-widget'], + queryKey: [params.id + '-' + params.title], queryFn: async ({ pageParam = 0 }) => { return await db.getAllEventsByKinds([1063], 20, pageParam); }, diff --git a/src/shared/widgets/local/follows.tsx b/src/shared/widgets/local/follows.tsx index d435b8dd..50f7a79e 100644 --- a/src/shared/widgets/local/follows.tsx +++ b/src/shared/widgets/local/follows.tsx @@ -23,7 +23,7 @@ export function LocalFollowsWidget({ params }: { params: Widget }) { const { db } = useStorage(); const { status, data, hasNextPage, isFetchingNextPage, fetchNextPage } = useInfiniteQuery({ - queryKey: ['local-follows-widget'], + queryKey: [params.id + '-' + params.title], queryFn: async ({ pageParam = 0 }) => { return await db.getAllEventsByAuthors(db.account.follows, 20, pageParam); }, @@ -70,7 +70,7 @@ export function LocalFollowsWidget({ params }: { params: Widget }) { data-index={index} ref={virtualizer.measureElement} > - + ); case 1063: diff --git a/src/shared/widgets/local/network.tsx b/src/shared/widgets/local/network.tsx index 68aa833e..ddd0d530 100644 --- a/src/shared/widgets/local/network.tsx +++ b/src/shared/widgets/local/network.tsx @@ -73,7 +73,7 @@ export function LocalNetworkWidget() { data-index={index} ref={virtualizer.measureElement} > - + ); case 1063: diff --git a/src/shared/widgets/local/user.tsx b/src/shared/widgets/local/user.tsx index 0759beee..4266d76c 100644 --- a/src/shared/widgets/local/user.tsx +++ b/src/shared/widgets/local/user.tsx @@ -23,7 +23,7 @@ import { Widget } from '@utils/types'; export function LocalUserWidget({ params }: { params: Widget }) { const { ndk } = useNDK(); const { status, data } = useQuery( - ['local-user-widget', params.content], + [params.id + '-' + params.title], async () => { const events = await ndk.fetchEvents({ kinds: [1, 6],