From 6afa44ddcb78b9f3a2824a06ac0166220ce05c4e Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 20 Dec 2024 16:57:19 +0000 Subject: [PATCH] Moderate composer quote (#7213) * moderate composer quote * consistency with other uses --- src/view/com/util/post-embeds/QuoteEmbed.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/view/com/util/post-embeds/QuoteEmbed.tsx b/src/view/com/util/post-embeds/QuoteEmbed.tsx index 77f5f6c951..cb549f7cda 100644 --- a/src/view/com/util/post-embeds/QuoteEmbed.tsx +++ b/src/view/com/util/post-embeds/QuoteEmbed.tsx @@ -26,7 +26,7 @@ import {useQueryClient} from '@tanstack/react-query' import {HITSLOP_20} from '#/lib/constants' import {usePalette} from '#/lib/hooks/usePalette' import {InfoCircleIcon} from '#/lib/icons' -import {moderatePost_wrapped} from '#/lib/moderatePost_wrapped' +import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped' import {makeProfileLink} from '#/lib/routes/links' import {s} from '#/lib/styles' import {useModerationOpts} from '#/state/preferences/moderation-opts' @@ -134,9 +134,7 @@ function QuoteEmbedModerated({ [viewRecord], ) const moderation = React.useMemo(() => { - return moderationOpts - ? moderatePost_wrapped(postView, moderationOpts) - : undefined + return moderationOpts ? moderatePost(postView, moderationOpts) : undefined }, [postView, moderationOpts]) return ( @@ -295,10 +293,14 @@ export function QuoteX({onRemove}: {onRemove: () => void}) { export function LazyQuoteEmbed({uri}: {uri: string}) { const {data} = useResolveLinkQuery(uri) + const moderationOpts = useModerationOpts() if (!data || data.type !== 'record' || data.kind !== 'post') { return null } - return + const moderation = moderationOpts + ? moderatePost(data.view, moderationOpts) + : undefined + return } function viewRecordToPostView(