From dfbc6c32d72283911ea8d4bef15e254cb562141d Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 22 Apr 2024 17:44:12 -0500 Subject: [PATCH] Handle timeline in feed infos --- src/state/queries/feed.ts | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/state/queries/feed.ts b/src/state/queries/feed.ts index e8243f699a..035b53605b 100644 --- a/src/state/queries/feed.ts +++ b/src/state/queries/feed.ts @@ -208,24 +208,6 @@ export function useSearchPopularFeedsMutation() { /** * The following feed, with fallbacks to Discover */ -const HOME_FEED_STUB: FeedSourceInfo = { - isPrimaryAlgorithm: false, - type: 'feed', - displayName: 'Following', - uri: 'home', - route: { - href: '/', - name: 'Home', - params: {}, - }, - cid: '', - avatar: '', - description: new RichText({text: ''}), - creatorDid: '', - creatorHandle: '', - likeCount: 0, - likeUri: '', -} const PWI_DISCOVER_FEED_STUB: FeedSourceInfo = { isPrimaryAlgorithm: true, type: 'feed', @@ -296,7 +278,7 @@ export function usePinnedFeedsInfos() { }), ) - const result = [hasSession ? HOME_FEED_STUB : PWI_DISCOVER_FEED_STUB] + const result = hasSession ? [] : [PWI_DISCOVER_FEED_STUB] await Promise.allSettled([feedsPromise, ...listsPromises]) @@ -305,6 +287,25 @@ export function usePinnedFeedsInfos() { const feedInfo = resolved.get(pinnedFeed.value) if (feedInfo) { result.push(feedInfo) + } else if (pinnedFeed.type === 'timeline') { + result.push({ + isPrimaryAlgorithm: false, + type: 'feed', + displayName: 'Following', + uri: pinnedFeed.value, + route: { + href: '/', + name: 'Home', + params: {}, + }, + cid: '', + avatar: '', + description: new RichText({text: ''}), + creatorDid: '', + creatorHandle: '', + likeCount: 0, + likeUri: '', + }) } }