Rework the me.follows cache to reduce network load (#384)
This commit is contained in:
parent
50f7f9877f
commit
25cc5b997f
13 changed files with 97 additions and 75 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue