From ebc2df8486e8ad39e3cef3c3684fa25b1274ef35 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 14 May 2024 15:49:27 -0500 Subject: [PATCH] Add temp notice of blocked by list --- src/components/dms/ConvoMenu.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/components/dms/ConvoMenu.tsx b/src/components/dms/ConvoMenu.tsx index 92315da466..45b8099816 100644 --- a/src/components/dms/ConvoMenu.tsx +++ b/src/components/dms/ConvoMenu.tsx @@ -54,6 +54,7 @@ let ConvoMenu = ({ const t = useTheme() const leaveConvoControl = Prompt.usePromptControl() const reportControl = Prompt.usePromptControl() + const blockedByListControl = Prompt.usePromptControl() const {mutate: markAsRead} = useMarkAsReadMutation() const {data: convo} = useConvoQuery(initialConvo) @@ -82,10 +83,16 @@ let ConvoMenu = ({ useAwaitedProfileUnblockMutation() const isBlockMutationPending = isBlockPending || isUnblockPending const isBlocking = Boolean(profile.viewer?.blocking) + const isBlockedByList = Boolean(profile.viewer?.blockingByList) const toggleBlock = useCallback(async () => { if (isBlockMutationPending) return + if (isBlockedByList) { + blockedByListControl.open() + return + } + if (profile.viewer?.blocking) { await unblockProfile({ subject: profile.did, @@ -102,6 +109,8 @@ let ConvoMenu = ({ blockProfile, unblockProfile, onUpdateConvo, + isBlockedByList, + blockedByListControl, ]) const {mutate: leaveConvo} = useLeaveConvo(convo?.id, { @@ -235,6 +244,16 @@ let ConvoMenu = ({ confirmButtonCta={_(msg`I understand`)} onConfirm={noop} /> + + ) }