diff options
author | dan <dan.abramov@gmail.com> | 2023-11-21 22:42:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-21 22:42:30 +0000 |
commit | 4c4ba553bdc4029e78eaf2ccf0f9df12e41a1b01 (patch) | |
tree | e97890d72da1fd0a2c10cc501f530a04dae3157a /src/view/com/profile/ProfileHeaderSuggestedFollows.tsx | |
parent | f18b9b32b0d296c8d19dc06956699f95c0af9be2 (diff) | |
download | voidsky-4c4ba553bdc4029e78eaf2ccf0f9df12e41a1b01.tar.zst |
Shadow refactoring and improvements (#1959)
* Make shadow a type-only concept * Prevent unnecessary init state recalc * Use derived state instead of effects * Batch emitter updates * Use object first seen time instead of dataUpdatedAt * Stop threading dataUpdatedAt through * Use same value consistently
Diffstat (limited to 'src/view/com/profile/ProfileHeaderSuggestedFollows.tsx')
-rw-r--r-- | src/view/com/profile/ProfileHeaderSuggestedFollows.tsx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/view/com/profile/ProfileHeaderSuggestedFollows.tsx b/src/view/com/profile/ProfileHeaderSuggestedFollows.tsx index 6e060af49..f648c9801 100644 --- a/src/view/com/profile/ProfileHeaderSuggestedFollows.tsx +++ b/src/view/com/profile/ProfileHeaderSuggestedFollows.tsx @@ -65,7 +65,7 @@ export function ProfileHeaderSuggestedFollows({ } }, [active, animatedHeight, track]) - const {isLoading, data, dataUpdatedAt} = useSuggestedFollowsByActorQuery({ + const {isLoading, data} = useSuggestedFollowsByActorQuery({ did: actorDid, }) @@ -127,11 +127,7 @@ export function ProfileHeaderSuggestedFollows({ </> ) : data ? ( data.suggestions.map(profile => ( - <SuggestedFollow - key={profile.did} - profile={profile} - dataUpdatedAt={dataUpdatedAt} - /> + <SuggestedFollow key={profile.did} profile={profile} /> )) ) : ( <View /> @@ -196,15 +192,13 @@ function SuggestedFollowSkeleton() { function SuggestedFollow({ profile: profileUnshadowed, - dataUpdatedAt, }: { profile: AppBskyActorDefs.ProfileView - dataUpdatedAt: number }) { const {track} = useAnalytics() const pal = usePalette('default') const moderationOpts = useModerationOpts() - const profile = useProfileShadow(profileUnshadowed, dataUpdatedAt) + const profile = useProfileShadow(profileUnshadowed) const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue(profile) const onPressFollow = React.useCallback(async () => { |