Use moderatePost_wrapped for post embeds (#4981)
* Use moderatePost_wrapped * Add lint rulezio/stable
parent
b5ea87c981
commit
fc5cc189b5
13
.eslintrc.js
13
.eslintrc.js
|
@ -71,6 +71,19 @@ module.exports = {
|
|||
'simple-import-sort/exports': 'warn',
|
||||
// TODO: Reenable when we figure out why it gets stuck on CI.
|
||||
// 'react-compiler/react-compiler': 'error',
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
{
|
||||
paths: [
|
||||
{
|
||||
name: '@atproto/api',
|
||||
importNames: ['moderatePost'],
|
||||
message:
|
||||
'Please use `moderatePost_wrapped` from `#/lib/moderatePost_wrapped` instead.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
ignorePatterns: [
|
||||
'**/__mocks__/*.ts',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import {moderatePost, BSKY_LABELER_DID} from '@atproto/api'
|
||||
/* eslint-disable-next-line no-restricted-imports */
|
||||
import {BSKY_LABELER_DID, moderatePost} from '@atproto/api'
|
||||
|
||||
type ModeratePost = typeof moderatePost
|
||||
type Options = Parameters<ModeratePost>[1]
|
||||
|
|
|
@ -13,7 +13,6 @@ import {
|
|||
AppBskyEmbedRecordWithMedia,
|
||||
AppBskyFeedDefs,
|
||||
AppBskyFeedPost,
|
||||
moderatePost,
|
||||
ModerationDecision,
|
||||
RichText as RichTextAPI,
|
||||
} from '@atproto/api'
|
||||
|
@ -24,6 +23,7 @@ import {useLingui} from '@lingui/react'
|
|||
import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {HITSLOP_20} from '#/lib/constants'
|
||||
import {moderatePost_wrapped} from '#/lib/moderatePost_wrapped'
|
||||
import {s} from '#/lib/styles'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {useSession} from '#/state/session'
|
||||
|
@ -122,7 +122,7 @@ function QuoteEmbedModerated({
|
|||
const moderationOpts = useModerationOpts()
|
||||
const moderation = React.useMemo(() => {
|
||||
return moderationOpts
|
||||
? moderatePost(viewRecordToPostView(viewRecord), moderationOpts)
|
||||
? moderatePost_wrapped(viewRecordToPostView(viewRecord), moderationOpts)
|
||||
: undefined
|
||||
}, [viewRecord, moderationOpts])
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable no-restricted-imports */
|
||||
import React from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {
|
||||
|
|
Loading…
Reference in New Issue