about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-08-01 17:49:43 +0100
committerGitHub <noreply@github.com>2024-08-01 17:49:43 +0100
commit388c157c366e67e0cb3d74e1cd05413ef41b235d (patch)
treeb55d4ff39e27d5a7440ea1707dc7d34595efead6 /src
parentb0e130a4d85f2056bddcbf210aa7ea4068d41686 (diff)
downloadvoidsky-388c157c366e67e0cb3d74e1cd05413ef41b235d.tar.zst
Display second-to-last rather than second post in a slice (#4864)
Diffstat (limited to 'src')
-rw-r--r--src/view/com/posts/FeedSlice.tsx23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/view/com/posts/FeedSlice.tsx b/src/view/com/posts/FeedSlice.tsx
index b8c9a1f2c..8d707d78e 100644
--- a/src/view/com/posts/FeedSlice.tsx
+++ b/src/view/com/posts/FeedSlice.tsx
@@ -19,6 +19,7 @@ let FeedSlice = ({
   hideTopBorder?: boolean
 }): React.ReactNode => {
   if (slice.isThread && slice.items.length > 3) {
+    const beforeLast = slice.items.length - 2
     const last = slice.items.length - 1
     return (
       <>
@@ -36,20 +37,20 @@ let FeedSlice = ({
           hideTopBorder={hideTopBorder}
           isParentBlocked={slice.items[0].isParentBlocked}
         />
+        <ViewFullThread slice={slice} />
         <FeedItem
-          key={slice.items[1]._reactKey}
-          post={slice.items[1].post}
-          record={slice.items[1].record}
-          reason={slice.items[1].reason}
-          feedContext={slice.items[1].feedContext}
-          parentAuthor={slice.items[1].parentAuthor}
+          key={slice.items[beforeLast]._reactKey}
+          post={slice.items[beforeLast].post}
+          record={slice.items[beforeLast].record}
+          reason={slice.items[beforeLast].reason}
+          feedContext={slice.items[beforeLast].feedContext}
+          parentAuthor={slice.items[beforeLast].parentAuthor}
           showReplyTo={false}
-          moderation={slice.items[1].moderation}
-          isThreadParent={isThreadParentAt(slice.items, 1)}
-          isThreadChild={isThreadChildAt(slice.items, 1)}
-          isParentBlocked={slice.items[1].isParentBlocked}
+          moderation={slice.items[beforeLast].moderation}
+          isThreadParent={isThreadParentAt(slice.items, beforeLast)}
+          isThreadChild={isThreadChildAt(slice.items, beforeLast)}
+          isParentBlocked={slice.items[beforeLast].isParentBlocked}
         />
-        <ViewFullThread slice={slice} />
         <FeedItem
           key={slice.items[last]._reactKey}
           post={slice.items[last].post}