From e5030d05564b256de941e2b4496d462c7c183276 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 9 Aug 2024 17:17:57 -0500 Subject: [PATCH] Correctly compute if user can edit reply settings --- src/view/com/util/forms/PostDropdownBtn.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/view/com/util/forms/PostDropdownBtn.tsx b/src/view/com/util/forms/PostDropdownBtn.tsx index 3ec8004d63..1f78f81e83 100644 --- a/src/view/com/util/forms/PostDropdownBtn.tsx +++ b/src/view/com/util/forms/PostDropdownBtn.tsx @@ -149,8 +149,7 @@ let PostDropdownBtn = ({ ) const isPostHidden = hiddenPosts && hiddenPosts.includes(postUri) const isAuthor = postAuthor.did === currentAccount?.did - const isRootPostAuthor = - rootPostUri && new AtUri(rootPostUri).host === currentAccount?.did + const isRootPostAuthor = new AtUri(rootUri).host === currentAccount?.did const isReplyHiddenByThreadgate = threadgateRecord?.hiddenReplies?.includes(postUri) @@ -648,6 +647,7 @@ let PostDropdownBtn = ({ control={postInteractionSettingsDialogControl} postUri={post.uri} threadgateRecord={threadgateRecord} + replySettingsDisabled={!isRootPostAuthor} /> ) @@ -657,6 +657,7 @@ export function PostInteractionSettingsDialogControlled(props: { control: Dialog.DialogControlProps postUri: string threadgateRecord?: AppBskyFeedThreadgate.Record + replySettingsDisabled: boolean }) { return ( @@ -670,6 +671,7 @@ function PostInteractionSettingsDialogControlledInner(props: { control: Dialog.DialogControlProps postUri: string threadgateRecord?: AppBskyFeedThreadgate.Record + replySettingsDisabled: boolean }) { const {_} = useLingui() const threadgateAllowUISettings = React.useMemo(() => { @@ -733,7 +735,7 @@ function PostInteractionSettingsDialogControlledInner(props: { ) : (