From 5459857112a25d1b99342c6dba9124c6f0a59450 Mon Sep 17 00:00:00 2001 From: DS Boyce <260543580+ds-boyce@users.noreply.github.com> Date: Tue, 10 Feb 2026 13:27:18 -0800 Subject: [PATCH 1/2] Use Tanstack Query status over isPending --- src/view/screens/Profile.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index d2f46a4dad..2f0dc4cc83 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -79,14 +79,14 @@ function ProfileScreenInner({route}: Props) { data: resolvedDid, error: resolveError, refetch: refetchDid, - isLoading: isLoadingDid, + status: didStatus, } = useResolveDidQuery(name) const { data: profile, error: profileError, refetch: refetchProfile, - isLoading: isLoadingProfile, isPlaceholderData: isPlaceholderProfile, + status: profileStatus, } = useProfileQuery({ did: resolvedDid, }) @@ -117,7 +117,7 @@ function ProfileScreenInner({route}: Props) { }, [queryClient, profile?.viewer?.blockedBy, resolvedDid]) // Most pushes will happen here, since we will have only placeholder data - if (isLoadingDid || isLoadingProfile) { + if (didStatus === 'pending' || profileStatus === 'pending') { return ( From 355868e01ea3ae892ff8a470d536709be7039440 Mon Sep 17 00:00:00 2001 From: DS Boyce <260543580+ds-boyce@users.noreply.github.com> Date: Wed, 11 Feb 2026 09:46:47 -0800 Subject: [PATCH 2/2] Address feedback and lint warnings --- src/view/screens/Profile.tsx | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index 2f0dc4cc83..dd1450c1c8 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -1,4 +1,4 @@ -import React, {useCallback, useMemo} from 'react' +import {useCallback, useEffect, useMemo, useRef, useState} from 'react' import {StyleSheet} from 'react-native' import {SafeAreaView} from 'react-native-safe-area-context' import { @@ -79,45 +79,45 @@ function ProfileScreenInner({route}: Props) { data: resolvedDid, error: resolveError, refetch: refetchDid, - status: didStatus, + isPending: isDidPending, } = useResolveDidQuery(name) const { data: profile, error: profileError, refetch: refetchProfile, isPlaceholderData: isPlaceholderProfile, - status: profileStatus, + isPending: isProfilePending, } = useProfileQuery({ did: resolvedDid, }) - const onPressTryAgain = React.useCallback(() => { + const onPressTryAgain = useCallback(() => { if (resolveError) { - refetchDid() + void refetchDid() } else { - refetchProfile() + void refetchProfile() } }, [resolveError, refetchDid, refetchProfile]) // Apply hard-coded redirects as need - React.useEffect(() => { + useEffect(() => { if (resolveError) { if (name === 'lulaoficial.bsky.social') { console.log('Applying redirect to lula.com.br') - navigate('Profile', {name: 'lula.com.br'}) + void navigate('Profile', {name: 'lula.com.br'}) } } }, [name, resolveError]) // When we open the profile, we want to reset the posts query if we are blocked. - React.useEffect(() => { + useEffect(() => { if (resolvedDid && profile?.viewer?.blockedBy) { resetProfilePostsQueries(queryClient, resolvedDid) } }, [queryClient, profile?.viewer?.blockedBy, resolvedDid]) // Most pushes will happen here, since we will have only placeholder data - if (didStatus === 'pending' || profileStatus === 'pending') { + if (isDidPending || isProfilePending) { return ( @@ -186,20 +186,20 @@ function ProfileScreenLoaded({ did: profile.did, enabled: !!profile.associated?.labeler, }) - const [currentPage, setCurrentPage] = React.useState(0) + const [currentPage, setCurrentPage] = useState(0) const {_} = useLingui() - const [scrollViewTag, setScrollViewTag] = React.useState(null) + const [scrollViewTag, setScrollViewTag] = useState(null) - const postsSectionRef = React.useRef(null) - const repliesSectionRef = React.useRef(null) - const mediaSectionRef = React.useRef(null) - const videosSectionRef = React.useRef(null) - const likesSectionRef = React.useRef(null) - const feedsSectionRef = React.useRef(null) - const listsSectionRef = React.useRef(null) - const starterPacksSectionRef = React.useRef(null) - const labelsSectionRef = React.useRef(null) + const postsSectionRef = useRef(null) + const repliesSectionRef = useRef(null) + const mediaSectionRef = useRef(null) + const videosSectionRef = useRef(null) + const likesSectionRef = useRef(null) + const feedsSectionRef = useRef(null) + const listsSectionRef = useRef(null) + const starterPacksSectionRef = useRef(null) + const labelsSectionRef = useRef(null) useSetTitle(combinedDisplayName(profile)) @@ -315,7 +315,7 @@ function ProfileScreenLoaded({ ) useFocusEffect( - React.useCallback(() => { + useCallback(() => { setMinimalShellMode(false) return listenSoftReset(() => { scrollSectionToTop(currentPage) @@ -601,16 +601,16 @@ function ProfileScreenLoaded({ function useRichText(text: string): [RichTextAPI, boolean] { const agent = useAgent() - const [prevText, setPrevText] = React.useState(text) - const [rawRT, setRawRT] = React.useState(() => new RichTextAPI({text})) - const [resolvedRT, setResolvedRT] = React.useState(null) + const [prevText, setPrevText] = useState(text) + const [rawRT, setRawRT] = useState(() => new RichTextAPI({text})) + const [resolvedRT, setResolvedRT] = useState(null) if (text !== prevText) { setPrevText(text) setRawRT(new RichTextAPI({text})) setResolvedRT(null) // This will queue an immediate re-render } - React.useEffect(() => { + useEffect(() => { let ignore = false async function resolveRTFacets() { // new each time @@ -620,7 +620,7 @@ function useRichText(text: string): [RichTextAPI, boolean] { setResolvedRT(resolvedRT) } } - resolveRTFacets() + void resolveRTFacets() return () => { ignore = true }