about summary refs log tree commit diff
path: root/src/view
diff options
context:
space:
mode:
Diffstat (limited to 'src/view')
-rw-r--r--src/view/com/post-thread/PostThread.tsx9
-rw-r--r--src/view/com/post-thread/PostThreadItem.tsx32
-rw-r--r--src/view/com/util/post-ctrls/PostCtrls.tsx2
3 files changed, 22 insertions, 21 deletions
diff --git a/src/view/com/post-thread/PostThread.tsx b/src/view/com/post-thread/PostThread.tsx
index bd778fd98..3757d76c6 100644
--- a/src/view/com/post-thread/PostThread.tsx
+++ b/src/view/com/post-thread/PostThread.tsx
@@ -129,17 +129,18 @@ export function PostThread({uri}: {uri: string | undefined}) {
     currentAccount &&
     rootPostUri &&
     currentAccount?.did === new AtUri(rootPostUri).host
+  const initialThreadgateRecord = rootPost?.threadgate?.record as
+    | AppBskyFeedThreadgate.Record
+    | undefined
   const {data: threadgateRecord} = useThreadgateRecordQuery({
     /**
      * If the user is the OP and the root post has a threadgate, we should load
      * the threadgate record. Otherwise, fallback to initialData, which is taken
      * from the response from `getPostThread`.
      */
-    enabled: Boolean(isOP && rootPostUri),
+    enabled: Boolean(isOP && rootPostUri && initialThreadgateRecord),
     postUri: rootPostUri,
-    initialData: rootPost?.threadgate?.record as
-      | AppBskyFeedThreadgate.Record
-      | undefined,
+    initialData: initialThreadgateRecord,
   })
 
   const moderationOpts = useModerationOpts()
diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx
index da187f5d9..f2cd8e85a 100644
--- a/src/view/com/post-thread/PostThreadItem.tsx
+++ b/src/view/com/post-thread/PostThreadItem.tsx
@@ -399,22 +399,6 @@ let PostThreadItemLoaded = ({
                     </Text>
                   </Link>
                 ) : null}
-                {post.likeCount != null && post.likeCount !== 0 ? (
-                  <Link
-                    style={styles.expandedInfoItem}
-                    href={likesHref}
-                    title={likesTitle}>
-                    <Text
-                      testID="likeCount-expanded"
-                      type="lg"
-                      style={pal.textLight}>
-                      <Text type="xl-bold" style={pal.text}>
-                        {formatCount(post.likeCount)}
-                      </Text>{' '}
-                      <Plural value={post.likeCount} one="like" other="likes" />
-                    </Text>
-                  </Link>
-                ) : null}
                 {post.quoteCount != null && post.quoteCount !== 0 ? (
                   <Link
                     style={styles.expandedInfoItem}
@@ -435,6 +419,22 @@ let PostThreadItemLoaded = ({
                     </Text>
                   </Link>
                 ) : null}
+                {post.likeCount != null && post.likeCount !== 0 ? (
+                  <Link
+                    style={styles.expandedInfoItem}
+                    href={likesHref}
+                    title={likesTitle}>
+                    <Text
+                      testID="likeCount-expanded"
+                      type="lg"
+                      style={pal.textLight}>
+                      <Text type="xl-bold" style={pal.text}>
+                        {formatCount(post.likeCount)}
+                      </Text>{' '}
+                      <Plural value={post.likeCount} one="like" other="likes" />
+                    </Text>
+                  </Link>
+                ) : null}
               </View>
             ) : null}
             <View style={[s.pl10, s.pr10]}>
diff --git a/src/view/com/util/post-ctrls/PostCtrls.tsx b/src/view/com/util/post-ctrls/PostCtrls.tsx
index 0cfa3fc4d..a0cef8692 100644
--- a/src/view/com/util/post-ctrls/PostCtrls.tsx
+++ b/src/view/com/util/post-ctrls/PostCtrls.tsx
@@ -255,7 +255,7 @@ let PostCtrls = ({
       <View style={big ? a.align_center : [a.flex_1, a.align_start]}>
         <RepostButton
           isReposted={!!post.viewer?.repost}
-          repostCount={post.repostCount}
+          repostCount={(post.repostCount ?? 0) + (post.quoteCount ?? 0)}
           onRepost={onRepost}
           onQuote={onQuote}
           big={big}