From a2db4d60981d5f4a537deab495a613895eb46262 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 7 Mar 2024 11:40:53 -0600 Subject: [PATCH] Fix type errors --- src/screens/Profile/Header/ProfileHeaderLabeler.tsx | 6 +++--- src/screens/Profile/Sections/Labels.tsx | 2 ++ src/state/session/index.tsx | 8 ++++++-- src/view/com/profile/ProfileCard.tsx | 2 +- src/view/screens/DebugMod.tsx | 6 +++--- src/view/screens/Storybook/Forms.tsx | 1 - 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx index bff5a72a89..64b6aebc33 100644 --- a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx +++ b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx @@ -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() diff --git a/src/screens/Profile/Sections/Labels.tsx b/src/screens/Profile/Sections/Labels.tsx index 11691e8818..20460ee4e0 100644 --- a/src/screens/Profile/Sections/Labels.tsx +++ b/src/screens/Profile/Sections/Labels.tsx @@ -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 ( ) { ) __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 { diff --git a/src/view/com/profile/ProfileCard.tsx b/src/view/com/profile/ProfileCard.tsx index 81de4568ff..b78596d68f 100644 --- a/src/view/com/profile/ProfileCard.tsx +++ b/src/view/com/profile/ProfileCard.tsx @@ -166,7 +166,7 @@ function ProfileCardPillModerationCause({ severity: 'alert' | 'inform' }) { const pal = usePalette('default') - const {name} = useModerationCauseDescription(cause, 'account') + const {name} = useModerationCauseDescription(cause) return ( -