Update to use new sdk updates

This commit is contained in:
Paul Frazee
2024-03-07 16:16:53 -08:00
parent b951bacdff
commit 59d5c8ecc0
13 changed files with 35 additions and 32 deletions
@@ -1,6 +1,6 @@
import React from 'react'
import {View} from 'react-native'
import {InterprettedLabelValueDefinition, LabelPreference} from '@atproto/api'
import {InterpretedLabelValueDefinition, LabelPreference} from '@atproto/api'
import {useLingui} from '@lingui/react'
import {msg} from '@lingui/macro'
@@ -18,7 +18,7 @@ export function GlobalModerationLabelPref({
labelValueDefinition,
disabled,
}: {
labelValueDefinition: InterprettedLabelValueDefinition
labelValueDefinition: InterpretedLabelValueDefinition
disabled?: boolean
}) {
const {_} = useLingui()
@@ -1,6 +1,6 @@
import React from 'react'
import {Pressable, View} from 'react-native'
import {InterprettedLabelValueDefinition, LabelPreference} from '@atproto/api'
import {InterpretedLabelValueDefinition, LabelPreference} from '@atproto/api'
import {useLingui} from '@lingui/react'
import {msg, Trans} from '@lingui/macro'
@@ -27,7 +27,7 @@ export function ModerationLabelPref({
labelerDid,
disabled,
}: {
labelValueDefinition: InterprettedLabelValueDefinition
labelValueDefinition: InterpretedLabelValueDefinition
labelerDid: string | undefined
disabled?: boolean
}) {
@@ -39,9 +39,8 @@ export function ModerationLabelPref({
const {data: preferences} = usePreferencesQuery()
const {mutate, variables} = usePreferencesSetContentLabelMutation()
const savedPref = labelerDid
? preferences?.moderationPrefs.mods.find(m => m.did === labelerDid)?.labels[
identifier
]
? preferences?.moderationPrefs.labelers.find(l => l.did === labelerDid)
?.labels[identifier]
: preferences?.moderationPrefs.labels[identifier]
const pref = variables?.visibility ?? savedPref ?? 'warn'