|
|
|
@ -1,7 +1,7 @@ |
|
|
|
import NoteCard from '@/components/NoteCard' |
|
|
|
import NoteCard from '@/components/NoteCard' |
|
|
|
import ProfileSearchBar from '@/components/ui/ProfileSearchBar' |
|
|
|
import ProfileSearchBar from '@/components/ui/ProfileSearchBar' |
|
|
|
import { Skeleton } from '@/components/ui/skeleton' |
|
|
|
import { Skeleton } from '@/components/ui/skeleton' |
|
|
|
import { ExtendedKind, PROFILE_POSTS_TAB_KINDS, PROFILE_PUBLICATIONS_TAB_KINDS } from '@/constants' |
|
|
|
import { ExtendedKind, PROFILE_POSTS_TAB_KINDS } from '@/constants' |
|
|
|
import { isReplyNoteEvent } from '@/lib/event' |
|
|
|
import { isReplyNoteEvent } from '@/lib/event' |
|
|
|
import { getZapInfoFromEvent } from '@/lib/event-metadata' |
|
|
|
import { getZapInfoFromEvent } from '@/lib/event-metadata' |
|
|
|
import { useProfilePins } from '@/hooks/useProfilePins' |
|
|
|
import { useProfilePins } from '@/hooks/useProfilePins' |
|
|
|
@ -54,7 +54,6 @@ const ProfileFeedWithPins = forwardRef<{ refresh: () => void }, { pubkey: string |
|
|
|
return next.sort((a, b) => a - b) |
|
|
|
return next.sort((a, b) => a - b) |
|
|
|
}, [showKinds]) |
|
|
|
}, [showKinds]) |
|
|
|
const hideReplies = useHideRepliesLikeMainFeed() |
|
|
|
const hideReplies = useHideRepliesLikeMainFeed() |
|
|
|
const publicationsKindSet = useMemo(() => new Set(PROFILE_PUBLICATIONS_TAB_KINDS), []) |
|
|
|
|
|
|
|
const [searchQuery, setSearchQuery] = useState('') |
|
|
|
const [searchQuery, setSearchQuery] = useState('') |
|
|
|
const [isRefreshing, setIsRefreshing] = useState(false) |
|
|
|
const [isRefreshing, setIsRefreshing] = useState(false) |
|
|
|
const [showCount, setShowCount] = useState(INITIAL_SHOW_COUNT) |
|
|
|
const [showCount, setShowCount] = useState(INITIAL_SHOW_COUNT) |
|
|
|
@ -75,7 +74,11 @@ const ProfileFeedWithPins = forwardRef<{ refresh: () => void }, { pubkey: string |
|
|
|
[zapReplyThreshold] |
|
|
|
[zapReplyThreshold] |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const cacheKey = useMemo(() => `${pubkey}-profile-unified-${zapReplyThreshold}`, [pubkey, zapReplyThreshold]) |
|
|
|
/** Bump when posts-tab `kinds` change so in-memory timeline cache is not reused across incompatible filters. */ |
|
|
|
|
|
|
|
const cacheKey = useMemo( |
|
|
|
|
|
|
|
() => `${pubkey}-profile-posts-tab-v2-${zapReplyThreshold}`, |
|
|
|
|
|
|
|
[pubkey, zapReplyThreshold] |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const postsTabKinds = useMemo(() => [...PROFILE_POSTS_TAB_KINDS], []) |
|
|
|
const postsTabKinds = useMemo(() => [...PROFILE_POSTS_TAB_KINDS], []) |
|
|
|
|
|
|
|
|
|
|
|
@ -163,11 +166,8 @@ const ProfileFeedWithPins = forwardRef<{ refresh: () => void }, { pubkey: string |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const filteredPins = useMemo( |
|
|
|
const filteredPins = useMemo( |
|
|
|
() => |
|
|
|
() => applySearch(pinEvents).filter((e) => !isEventDeleted(e)), |
|
|
|
applySearch(pinEvents) |
|
|
|
[pinEvents, applySearch, isEventDeleted] |
|
|
|
.filter((e) => !isEventDeleted(e)) |
|
|
|
|
|
|
|
.filter((e) => !publicationsKindSet.has(e.kind)), |
|
|
|
|
|
|
|
[pinEvents, applySearch, isEventDeleted, publicationsKindSet] |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
const filteredRest = useMemo( |
|
|
|
const filteredRest = useMemo( |
|
|
|
() => |
|
|
|
() => |
|
|
|
|