This commit is contained in:
Eric Bailey 2024-05-30 23:56:09 -05:00 committed by GitHub
parent 89c9fd3be1
commit d614f6cb71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 149 additions and 11 deletions

View file

@ -1,4 +1,4 @@
import React, {useState} from 'react'
import React from 'react'
import {View} from 'react-native'
import {AppBskyActorDefs, ModerationDecision} from '@atproto/api'
import {msg} from '@lingui/macro'
@ -39,7 +39,6 @@ export function AviFollowButton({
})
const gate = useGate()
const {currentAccount, hasSession} = useSession()
const [followed, setFollowed] = useState<string | null>(null)
const navigation = useNavigation<NavigationProp>()
const name = sanitizeDisplayName(
@ -47,13 +46,10 @@ export function AviFollowButton({
moderation.ui('displayName'),
)
const isFollowing =
profile.viewer?.following ||
profile.did === followed ||
profile.did === currentAccount?.did
profile.viewer?.following || profile.did === currentAccount?.did
function onPress() {
follow()
setFollowed(profile.did)
Toast.show(_(msg`Following ${name}`))
}