about summary refs log tree commit diff
path: root/src/view/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/com')
-rw-r--r--src/view/com/profile/FollowButton.tsx3
-rw-r--r--src/view/com/profile/ProfileCard.tsx8
2 files changed, 10 insertions, 1 deletions
diff --git a/src/view/com/profile/FollowButton.tsx b/src/view/com/profile/FollowButton.tsx
index c2d76316e..ff58dc945 100644
--- a/src/view/com/profile/FollowButton.tsx
+++ b/src/view/com/profile/FollowButton.tsx
@@ -14,12 +14,14 @@ export function FollowButton({
   profile,
   labelStyle,
   logContext,
+  onFollow,
 }: {
   unfollowedType?: ButtonType
   followedType?: ButtonType
   profile: Shadow<AppBskyActorDefs.ProfileViewBasic>
   labelStyle?: StyleProp<TextStyle>
   logContext: 'ProfileCard' | 'StarterPackProfilesList'
+  onFollow?: () => void
 }) {
   const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue(
     profile,
@@ -30,6 +32,7 @@ export function FollowButton({
   const onPressFollow = async () => {
     try {
       await queueFollow()
+      onFollow?.()
     } catch (e: any) {
       if (e?.name !== 'AbortError') {
         Toast.show(_(msg`An issue occurred, please try again.`), 'xmark')
diff --git a/src/view/com/profile/ProfileCard.tsx b/src/view/com/profile/ProfileCard.tsx
index eab8611dd..f710d7b4e 100644
--- a/src/view/com/profile/ProfileCard.tsx
+++ b/src/view/com/profile/ProfileCard.tsx
@@ -184,6 +184,7 @@ export function ProfileCardWithFollowBtn({
   noBg,
   noBorder,
   onPress,
+  onFollow,
   logContext = 'ProfileCard',
   showKnownFollowers,
 }: {
@@ -191,6 +192,7 @@ export function ProfileCardWithFollowBtn({
   noBg?: boolean
   noBorder?: boolean
   onPress?: () => void
+  onFollow?: () => void
   logContext?: 'ProfileCard' | 'StarterPackProfilesList'
   showKnownFollowers?: boolean
 }) {
@@ -206,7 +208,11 @@ export function ProfileCardWithFollowBtn({
         isMe
           ? undefined
           : profileShadow => (
-              <FollowButton profile={profileShadow} logContext={logContext} />
+              <FollowButton
+                profile={profileShadow}
+                logContext={logContext}
+                onFollow={onFollow}
+              />
             )
       }
       onPress={onPress}