Add protocol:nostr to saved feed queries for latest results
The previous useStreamPosts always injected 'protocol:nostr' into the NIP-50 search string, which is a Ditto relay extension that filters for native Nostr events. Without it, useTabFeed's queries return stale or fewer results because the relay doesn't scope to the Nostr protocol. Augment the resolved filter's search field with 'protocol:nostr' before passing it to useTabFeed, matching the old behavior.
This commit is contained in:
+13
-1
@@ -374,13 +374,25 @@ function SavedFeedContent({ feed }: { feed: SavedFeed }) {
|
||||
user?.pubkey ?? '',
|
||||
);
|
||||
|
||||
// Augment the resolved filter with protocol:nostr (NIP-50 Ditto extension)
|
||||
// to match the behavior of the core feeds and ensure latest native Nostr
|
||||
// posts are returned.
|
||||
const augmentedFilter = useMemo(() => {
|
||||
if (!resolvedFilter) return null;
|
||||
const existing = resolvedFilter.search ?? '';
|
||||
const search = existing
|
||||
? `${existing} protocol:nostr`
|
||||
: 'protocol:nostr';
|
||||
return { ...resolvedFilter, search };
|
||||
}, [resolvedFilter]);
|
||||
|
||||
const {
|
||||
data: rawData,
|
||||
isLoading: isFeedLoading,
|
||||
fetchNextPage,
|
||||
hasNextPage,
|
||||
isFetchingNextPage,
|
||||
} = useTabFeed(resolvedFilter, `saved-${feed.id}`, !isResolving);
|
||||
} = useTabFeed(augmentedFilter, `saved-${feed.id}`, !isResolving);
|
||||
|
||||
const isLoading = isResolving || isFeedLoading;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user