Fix type errors

This commit is contained in:
Eric Bailey
2024-03-07 11:40:53 -06:00
parent 38b217458a
commit a2db4d6098
6 changed files with 15 additions and 10 deletions
@@ -77,9 +77,9 @@ let ProfileHeaderLabeler = ({
variables?.subscribe ??
preferences?.moderationPrefs.mods.find(mod => mod.did === profile.did)
const canSubscribe =
isSubscribed || preferences
? preferences.moderationPrefs.mods.length < 10
: false
isSubscribed || (preferences
? preferences?.moderationPrefs.mods.length < 10
: false)
const {mutateAsync: likeMod, isPending: isLikePending} = useLikeMutation()
const {mutateAsync: unlikeMod, isPending: isUnlikePending} =
useUnlikeMutation()
+2
View File
@@ -54,6 +54,7 @@ export const ProfileLabelsSection = React.forwardRef<
const {height: minHeight} = useSafeAreaFrame()
const onScrollToTop = React.useCallback(() => {
// @ts-ignore TODO fix this
scrollElRef.current?.scrollTo({
animated: isNative,
x: 0,
@@ -143,6 +144,7 @@ export function ProfileLabelsSectionInner({
return (
<ScrollView
// @ts-ignore TODO fix this
ref={scrollElRef}
scrollEventThrottle={1}
contentContainerStyle={{
+6 -2
View File
@@ -3,6 +3,8 @@ import {BskyAgent, AtpPersistSessionHandler} from '@atproto/api'
import {useQueryClient} from '@tanstack/react-query'
import {jwtDecode} from 'jwt-decode'
import {IS_DEV} from '#/env'
import {isWeb} from '#/platform/detection'
import {networkRetry} from '#/lib/async/retry'
import {logger} from '#/logger'
import * as persisted from '#/state/persisted'
@@ -309,7 +311,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
)
__globalAgent = agent
window.agent = agent
// @ts-ignore
if (IS_DEV && isWeb) window.agent = agent
queryClient.clear()
upsertAccount(account)
@@ -349,7 +352,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
{networkErrorCallback: clearCurrentAccount},
),
})
window.agent = agent
// @ts-ignore
if (IS_DEV && isWeb) window.agent = agent
let canReusePrevSession = false
try {
+1 -1
View File
@@ -166,7 +166,7 @@ function ProfileCardPillModerationCause({
severity: 'alert' | 'inform'
}) {
const pal = usePalette('default')
const {name} = useModerationCauseDescription(cause, 'account')
const {name} = useModerationCauseDescription(cause)
return (
<View
style={[s.mt5, pal.btn, styles.pill]}
+3 -3
View File
@@ -38,7 +38,7 @@ import {
ChevronTop_Stroke2_Corner0_Rounded as ChevronTop,
} from '#/components/icons/Chevron'
import {ScreenHider} from '../../components/moderation/ScreenHider'
import {ProfileHeader} from '#/screens/Profile/Header'
import {ProfileHeaderStandard} from '#/screens/Profile/Header/ProfileHeaderStandard'
import {ProfileCard} from '../com/profile/ProfileCard'
import {FeedItem} from '../com/posts/FeedItem'
import {FeedItem as NotifFeedItem} from '../com/notifications/FeedItem'
@@ -243,7 +243,7 @@ export const DebugModScreen = ({}: NativeStackScreenProps<
],
},
labelDefs: {
'did:plc:fake-labeler': [interpretLabelValueDefinition(customLabelDef)],
'did:plc:fake-labeler': [interpretLabelValueDefinition(customLabelDef, 'did:plc:fake-labeler')],
},
}
}, [label, visibility, noAdult, isLoggedOut, isTargetMe, did, customLabelDef])
@@ -880,7 +880,7 @@ function MockAccountScreen({
style={{}}
screenDescription="profile"
modui={moderation.ui('profileView')}>
<ProfileHeader
<ProfileHeaderStandard
// @ts-ignore ProfileViewBasic is close enough -prf
profile={profile}
moderationOpts={moderationOpts}
-1
View File
@@ -62,7 +62,6 @@ export function Forms() {
value={value}
onChangeText={setValue}
label="Text field"
disabled
/>
</View>