diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-04-03 19:50:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 19:50:46 -0500 |
commit | 25cc5b997f07daaeb64ef434992cb95892546ff5 (patch) | |
tree | 09531de05bbce7edddc9b5d48cb4cd56bdabcf90 /src/view/com/profile/ProfileHeader.tsx | |
parent | 50f7f9877ff000fac3a22d4432253f91657b7e61 (diff) | |
download | voidsky-25cc5b997f07daaeb64ef434992cb95892546ff5.tar.zst |
Rework the me.follows cache to reduce network load (#384)
Diffstat (limited to 'src/view/com/profile/ProfileHeader.tsx')
-rw-r--r-- | src/view/com/profile/ProfileHeader.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index 878d837c9..36aadb9e2 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -30,6 +30,7 @@ import {usePalette} from 'lib/hooks/usePalette' import {useAnalytics} from 'lib/analytics' import {NavigationProp} from 'lib/routes/types' import {isDesktopWeb} from 'platform/detection' +import {FollowState} from 'state/models/cache/my-follows' const BACK_HITSLOP = {left: 30, top: 30, right: 30, bottom: 30} @@ -219,7 +220,8 @@ const ProfileHeaderLoaded = observer(function ProfileHeaderLoaded({ </TouchableOpacity> ) : ( <> - {store.me.follows.isFollowing(view.did) ? ( + {store.me.follows.getFollowState(view.did) === + FollowState.Following ? ( <TouchableOpacity testID="unfollowBtn" onPress={onPressToggleFollow} |