Skip to content

Commit

Permalink
rm moderatePost_wrapped
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzius authored and estrattonbailey committed Dec 20, 2024
1 parent 8a3dfcb commit afef1c0
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 54 deletions.
13 changes: 0 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,6 @@ module.exports = {
],
'simple-import-sort/exports': 'error',
'react-compiler/react-compiler': 'warn',
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@atproto/api',
importNames: ['moderatePost'],
message:
'Please use `moderatePost_wrapped` from `#/lib/moderatePost_wrapped` instead.',
},
],
},
],
},
ignorePatterns: [
'**/__mocks__/*.ts',
Expand Down
31 changes: 0 additions & 31 deletions src/lib/moderatePost_wrapped.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/screens/Messages/components/MessageInputEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import {
AppBskyFeedPost,
AppBskyRichtextFacet,
AtUri,
moderatePost,
RichText as RichTextAPI,
} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {RouteProp, useNavigation, useRoute} from '@react-navigation/native'

import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped'
import {makeProfileLink} from '#/lib/routes/links'
import {CommonNavigatorParams, NavigationProp} from '#/lib/routes/types'
import {
Expand Down
2 changes: 1 addition & 1 deletion src/state/queries/notifications/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
AppBskyFeedDefs,
AppBskyFeedPost,
AtUri,
moderatePost,
} from '@atproto/api'
import {
InfiniteData,
Expand All @@ -31,7 +32,6 @@ import {
useQueryClient,
} from '@tanstack/react-query'

import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped'
import {useAgent} from '#/state/session'
import {useThreadgateHiddenReplyUris} from '#/state/threadgate-hidden-replies'
import {useModerationOpts} from '../../preferences/moderation-opts'
Expand Down
2 changes: 1 addition & 1 deletion src/state/queries/post-feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
AppBskyFeedPost,
AtUri,
BskyAgent,
moderatePost,
ModerationDecision,
} from '@atproto/api'
import {
Expand All @@ -27,7 +28,6 @@ import {aggregateUserInterests} from '#/lib/api/feed/utils'
import {FeedTuner, FeedTunerFn} from '#/lib/api/feed-manip'
import {DISCOVER_FEED_URI} from '#/lib/constants'
import {BSKY_FEED_OWNER_DIDS} from '#/lib/constants'
import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped'
import {logger} from '#/logger'
import {STALE} from '#/state/queries'
import {DEFAULT_LOGGED_OUT_PREFERENCES} from '#/state/queries/preferences/const'
Expand Down
2 changes: 1 addition & 1 deletion src/state/queries/post-thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import {
AppBskyFeedGetPostThread,
AppBskyFeedPost,
AtUri,
moderatePost,
ModerationDecision,
ModerationOpts,
} from '@atproto/api'
import {QueryClient, useQuery, useQueryClient} from '@tanstack/react-query'

import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped'
import {findAllPostsInQueryData as findAllPostsInQuoteQueryData} from '#/state/queries/post-quotes'
import {UsePreferencesQueryResponse} from '#/state/queries/preferences/types'
import {
Expand Down
2 changes: 1 addition & 1 deletion src/state/queries/search-posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AppBskyFeedDefs,
AppBskyFeedSearchPosts,
AtUri,
moderatePost,
} from '@atproto/api'
import {
InfiniteData,
Expand All @@ -12,7 +13,6 @@ import {
useInfiniteQuery,
} from '@tanstack/react-query'

import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped'
import {useModerationOpts} from '#/state/preferences/moderation-opts'
import {useAgent} from '#/state/session'
import {
Expand Down
2 changes: 1 addition & 1 deletion src/view/com/post-thread/PostQuotes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import {useCallback, useState} from 'react'
import {
AppBskyFeedDefs,
AppBskyFeedPost,
moderatePost,
ModerationDecision,
} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'

import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped'
import {cleanError} from '#/lib/strings/errors'
import {logger} from '#/logger'
import {useModerationOpts} from '#/state/preferences/moderation-opts'
Expand Down
7 changes: 5 additions & 2 deletions src/view/com/post-thread/PostThread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import {StyleSheet, useWindowDimensions, View} from 'react-native'
import {runOnJS} from 'react-native-reanimated'
import Animated from 'react-native-reanimated'
import {useSafeAreaInsets} from 'react-native-safe-area-context'
import {AppBskyFeedDefs, AppBskyFeedThreadgate} from '@atproto/api'
import {
AppBskyFeedDefs,
AppBskyFeedThreadgate,
moderatePost,
} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'

Expand All @@ -12,7 +16,6 @@ import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
import {useMinimalShellFabTransform} from '#/lib/hooks/useMinimalShellTransform'
import {useSetTitle} from '#/lib/hooks/useSetTitle'
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped'
import {clamp} from '#/lib/numbers'
import {ScrollProvider} from '#/lib/ScrollContext'
import {sanitizeDisplayName} from '#/lib/strings/display-names'
Expand Down
2 changes: 1 addition & 1 deletion src/view/com/post/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
AppBskyFeedDefs,
AppBskyFeedPost,
AtUri,
moderatePost,
ModerationDecision,
RichText as RichTextAPI,
} from '@atproto/api'
Expand All @@ -14,7 +15,6 @@ import {useQueryClient} from '@tanstack/react-query'

import {MAX_POST_LINES} from '#/lib/constants'
import {usePalette} from '#/lib/hooks/usePalette'
import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped'
import {makeProfileLink} from '#/lib/routes/links'
import {countLines} from '#/lib/strings/helpers'
import {colors, s} from '#/lib/styles'
Expand Down
2 changes: 1 addition & 1 deletion src/view/com/util/post-embeds/QuoteEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
AppBskyEmbedVideo,
AppBskyFeedDefs,
AppBskyFeedPost,
moderatePost,
ModerationDecision,
RichText as RichTextAPI,
} from '@atproto/api'
Expand All @@ -26,7 +27,6 @@ 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 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

0 comments on commit afef1c0

Please sign in to comment.