diff options
author | Hailey <me@haileyok.com> | 2024-05-23 11:35:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-23 19:35:49 +0100 |
commit | 70f190d44f314fa91b860c29e2f04b4955c1b8b2 (patch) | |
tree | 5579af5bbd93e17ca2a3fd38f2db2a448e2856ab /src/view/com/posts/FeedSlice.tsx | |
parent | 6d647551cd2fcf9d66c3795df8f6764bf60f6df1 (diff) | |
download | voidsky-70f190d44f314fa91b860c29e2f04b4955c1b8b2.tar.zst |
Remove `getProfile` calls when loading feed (#3881)
* remove unnecessary `getProfile()` calls from feed load add comments ensure only if first simplify nit handle cases where the parent is removed add a comment remove unnecessary `getProfile()` calls from feed load limit only to the first post in the returned items move the logic out of the render and into the query add the grandparent properly update `FeedItem` bump package update `FeedItem` update `post-feed` query update `FeedSlice` * nit * simplify logic * always pass `parentAuthor` * oops! * update `DebugMod`
Diffstat (limited to 'src/view/com/posts/FeedSlice.tsx')
-rw-r--r-- | src/view/com/posts/FeedSlice.tsx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/view/com/posts/FeedSlice.tsx b/src/view/com/posts/FeedSlice.tsx index 27a9ff8c0..6d8f038b4 100644 --- a/src/view/com/posts/FeedSlice.tsx +++ b/src/view/com/posts/FeedSlice.tsx @@ -22,6 +22,8 @@ let FeedSlice = ({slice}: {slice: FeedPostSlice}): React.ReactNode => { record={slice.items[0].record} reason={slice.items[0].reason} feedContext={slice.items[0].feedContext} + parentAuthor={slice.items[0].parentAuthor} + showReplyTo={true} moderation={slice.items[0].moderation} isThreadParent={isThreadParentAt(slice.items, 0)} isThreadChild={isThreadChildAt(slice.items, 0)} @@ -32,6 +34,8 @@ let FeedSlice = ({slice}: {slice: FeedPostSlice}): React.ReactNode => { record={slice.items[1].record} reason={slice.items[1].reason} feedContext={slice.items[1].feedContext} + parentAuthor={slice.items[1].parentAuthor} + showReplyTo={false} moderation={slice.items[1].moderation} isThreadParent={isThreadParentAt(slice.items, 1)} isThreadChild={isThreadChildAt(slice.items, 1)} @@ -43,6 +47,8 @@ let FeedSlice = ({slice}: {slice: FeedPostSlice}): React.ReactNode => { record={slice.items[last].record} reason={slice.items[last].reason} feedContext={slice.items[last].feedContext} + parentAuthor={slice.items[2].parentAuthor} + showReplyTo={false} moderation={slice.items[last].moderation} isThreadParent={isThreadParentAt(slice.items, last)} isThreadChild={isThreadChildAt(slice.items, last)} @@ -62,6 +68,8 @@ let FeedSlice = ({slice}: {slice: FeedPostSlice}): React.ReactNode => { reason={slice.items[i].reason} feedContext={slice.items[i].feedContext} moderation={slice.items[i].moderation} + parentAuthor={slice.items[i].parentAuthor} + showReplyTo={i === 0} isThreadParent={isThreadParentAt(slice.items, i)} isThreadChild={isThreadChildAt(slice.items, i)} isThreadLastChild={ |