Skip to content

Commit

Permalink
Update packages/react/src/transactions/useFollow.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Cesare Naldi <[email protected]>
  • Loading branch information
krzysu and cesarenaldi committed Aug 10, 2023
1 parent 78dddaf commit d9c7360
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react/src/transactions/useFollow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ export function useFollow({ followee, follower }: UseFollowArgs): FollowOperatio
);
}

invariant(followee.followStatus?.canFollow, 'You already follow this profile');
invariant(
followee.followStatus?.canFollow,
"You're already following this profile. Check the `followee.followStatus.canFollow` to determine if you can call `useFollow`.",
);

const request = createFollowRequest(followee, follower);
return follow(request);
Expand Down

0 comments on commit d9c7360

Please sign in to comment.