Update to use new sdk updates
This commit is contained in:
@@ -86,7 +86,9 @@ export function ModerationScreen(
|
||||
data: labelers,
|
||||
error: labelersError,
|
||||
} = useLabelersDetailedInfoQuery({
|
||||
dids: preferences ? preferences.moderationPrefs.mods.map(m => m.did) : [],
|
||||
dids: preferences
|
||||
? preferences.moderationPrefs.labelers.map(l => l.did)
|
||||
: [],
|
||||
})
|
||||
const {gtMobile} = useBreakpoints()
|
||||
const {height} = useSafeAreaFrame()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {LabelPreference, InterprettedLabelValueDefinition} from '@atproto/api'
|
||||
import {LabelPreference, InterpretedLabelValueDefinition} from '@atproto/api'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {msg} from '@lingui/macro'
|
||||
import Animated, {Easing, Layout, FadeIn} from 'react-native-reanimated'
|
||||
@@ -18,7 +18,7 @@ export function ModerationOption({
|
||||
labelValueDefinition,
|
||||
isMounted,
|
||||
}: {
|
||||
labelValueDefinition: InterprettedLabelValueDefinition
|
||||
labelValueDefinition: InterpretedLabelValueDefinition
|
||||
isMounted: React.MutableRefObject<boolean>
|
||||
}) {
|
||||
const {_} = useLingui()
|
||||
|
||||
@@ -75,10 +75,10 @@ let ProfileHeaderLabeler = ({
|
||||
useLabelerSubscriptionMutation()
|
||||
const isSubscribed =
|
||||
variables?.subscribe ??
|
||||
preferences?.moderationPrefs.mods.find(mod => mod.did === profile.did)
|
||||
preferences?.moderationPrefs.labelers.find(l => l.did === profile.did)
|
||||
const canSubscribe =
|
||||
isSubscribed ||
|
||||
(preferences ? preferences?.moderationPrefs.mods.length < 10 : false)
|
||||
(preferences ? preferences?.moderationPrefs.labelers.length < 10 : false)
|
||||
const {mutateAsync: likeMod, isPending: isLikePending} = useLikeMutation()
|
||||
const {mutateAsync: unlikeMod, isPending: isUnlikePending} =
|
||||
useUnlikeMutation()
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
AppBskyLabelerDefs,
|
||||
ModerationOpts,
|
||||
interpretLabelValueDefinitions,
|
||||
InterprettedLabelValueDefinition,
|
||||
InterpretedLabelValueDefinition,
|
||||
} from '@atproto/api'
|
||||
import {Trans, msg} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
@@ -126,8 +126,8 @@ export function ProfileLabelsSectionInner({
|
||||
})
|
||||
|
||||
const {labelValues} = labelerInfo.policies
|
||||
const isSubscribed = moderationOpts.prefs.mods.find(
|
||||
mod => mod.did === labelerInfo.creator.did,
|
||||
const isSubscribed = moderationOpts.prefs.labelers.find(
|
||||
l => l.did === labelerInfo.creator.did,
|
||||
)
|
||||
const labelDefs = React.useMemo(() => {
|
||||
const customDefs = interpretLabelValueDefinitions(labelerInfo)
|
||||
@@ -135,7 +135,7 @@ export function ProfileLabelsSectionInner({
|
||||
.map(val => lookupLabelValueDefinition(val, customDefs))
|
||||
.filter(
|
||||
def => def && def?.configurable,
|
||||
) as InterprettedLabelValueDefinition[]
|
||||
) as InterpretedLabelValueDefinition[]
|
||||
}, [labelerInfo, labelValues])
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user