Skip to content

Commit

Permalink
Moderate composer quote (#7213)
Browse files Browse the repository at this point in the history
* moderate composer quote

* consistency with other uses
  • Loading branch information
mozzius authored Dec 20, 2024
1 parent ab0697a commit 6afa44d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/view/com/util/post-embeds/QuoteEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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 <QuoteEmbed quote={data.view} />
const moderation = moderationOpts
? moderatePost(data.view, moderationOpts)
: undefined
return <QuoteEmbed quote={data.view} moderation={moderation} />
}

function viewRecordToPostView(
Expand Down

0 comments on commit 6afa44d

Please sign in to comment.