about summary refs log tree commit diff
path: root/src/view/com/post-thread/PostThreadItem.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2025-02-11 16:07:10 -0600
committerGitHub <noreply@github.com>2025-02-11 14:07:10 -0800
commit459611ca7a0d1559e3c9373ef9a61ea8e4c1e2f7 (patch)
tree12808a7ee8f9abce9bf06c50b047a9c426fc04f1 /src/view/com/post-thread/PostThreadItem.tsx
parent03f75e8ff49d8fa0f7b96321ba8d3a5dd8841703 (diff)
downloadvoidsky-459611ca7a0d1559e3c9373ef9a61ea8e4c1e2f7.tar.zst
[APP-1031] Add new followerRule to threadgate settings (#7681)
* Add new followerRule to threadgate settings

* Handle WhoCanReply copy

* Handle follow case

* fix ci

* Revert "Handle follow case"

This reverts commit bc454dad896fe577bec91f3d65d971ad9e0fec8d.

* Hide Follow button if followedBy rule enabled

* Revert "Revert "Handle follow case""

This reverts commit cadc46d2dc50120424ed460943775c58efc59c4d.

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Diffstat (limited to 'src/view/com/post-thread/PostThreadItem.tsx')
-rw-r--r--src/view/com/post-thread/PostThreadItem.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx
index 4f950e261..928ccd783 100644
--- a/src/view/com/post-thread/PostThreadItem.tsx
+++ b/src/view/com/post-thread/PostThreadItem.tsx
@@ -241,6 +241,11 @@ let PostThreadItemLoaded = ({
     return makeProfileLink(post.author, 'post', urip.rkey, 'quotes')
   }, [post.uri, post.author])
   const quotesTitle = _(msg`Quotes of this post`)
+  const onlyFollowersCanReply = !!threadgateRecord?.allow?.find(
+    rule => rule.$type === 'app.bsky.feed.threadgate#followerRule',
+  )
+  const showFollowButton =
+    currentAccount?.did !== post.author.did && !onlyFollowersCanReply
 
   const translatorUrl = getTranslatorLink(
     record?.text || '',
@@ -343,7 +348,7 @@ let PostThreadItemLoaded = ({
                 </Text>
               </Link>
             </View>
-            {currentAccount?.did !== post.author.did && (
+            {showFollowButton && (
               <View>
                 <PostThreadFollowBtn did={post.author.did} />
               </View>