diff --git a/src/@types/subsocial.d.ts b/src/@types/subsocial.d.ts index e1292cb4e..e29dc63a6 100644 --- a/src/@types/subsocial.d.ts +++ b/src/@types/subsocial.d.ts @@ -101,6 +101,7 @@ declare module '@subsocial/api/types' { blockchainSyncFailed?: boolean dataType?: 'persistent' | 'optimistic' | 'offChain' parentPostId?: string | null + approvedInRootPost?: boolean }, PostContent > & { requestedId?: string } diff --git a/src/components/chats/ChatItem/ChatItem.tsx b/src/components/chats/ChatItem/ChatItem.tsx index 6a847a883..b039906b2 100644 --- a/src/components/chats/ChatItem/ChatItem.tsx +++ b/src/components/chats/ChatItem/ChatItem.tsx @@ -52,6 +52,9 @@ export default function ChatItem({ const canRenderEmbed = useCanRenderEmbed(link ?? '') + if (showApproveButton && message.struct.approvedInRootPost) return null + if (!showApproveButton && !message.struct.approvedInRootPost) return null + if (!body && (!extensions || extensions.length === 0)) return null const isEmojiOnly = shouldRenderEmojiChatItem(body ?? '') diff --git a/src/components/extensions/common/CommonChatItem.tsx b/src/components/extensions/common/CommonChatItem.tsx index ac5a6e3e0..415554356 100644 --- a/src/components/extensions/common/CommonChatItem.tsx +++ b/src/components/extensions/common/CommonChatItem.tsx @@ -1,7 +1,6 @@ import Button from '@/components/Button' import LinkText from '@/components/LinkText' import { ProfilePreviewModalName } from '@/components/ProfilePreviewModalWrapper' -import Toast from '@/components/Toast' import { useModerateWithSuccessToast } from '@/components/chats/ChatItem/ChatItemMenus' import ChatRelativeTime from '@/components/chats/ChatItem/ChatRelativeTime' import MessageStatusIndicator from '@/components/chats/ChatItem/MessageStatusIndicator' @@ -18,7 +17,6 @@ import { useMyMainAddress } from '@/stores/my-account' import { cx } from '@/utils/class-names' import { getTimeRelativeToNow } from '@/utils/date' import Linkify from 'linkify-react' -import { toast } from 'sonner' import { ExtensionChatItemProps } from '../types' type DerivativesData = { @@ -324,19 +322,7 @@ function ApproveButton({ ownerId: string }) { const { data: profile } = getProfileQuery.useQuery(ownerId) - const { mutate } = useApproveUser({ - onSuccess: () => { - toast.custom((t) => ( - - )) - }, - }) + const { mutate } = useApproveUser() return (