From 0cbd3aedba0b6c1991818ab28cc223c62853511f Mon Sep 17 00:00:00 2001 From: Untone Date: Sun, 5 May 2024 20:04:47 +0300 Subject: [PATCH] following-debug --- src/components/Author/AuthorBadge/AuthorBadge.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/Author/AuthorBadge/AuthorBadge.tsx b/src/components/Author/AuthorBadge/AuthorBadge.tsx index 730b42c2..19a2deb3 100644 --- a/src/components/Author/AuthorBadge/AuthorBadge.tsx +++ b/src/components/Author/AuthorBadge/AuthorBadge.tsx @@ -72,10 +72,9 @@ export const AuthorBadge = (props: Props) => { }) const handleFollowClick = () => { - requireAuthentication(() => { - isSubscribed() - ? unfollow(FollowingEntity.Author, props.author.slug) - : follow(FollowingEntity.Author, props.author.slug) + requireAuthentication(async () => { + const handle = isSubscribed() ? unfollow : follow + await handle(FollowingEntity.Author, props.author.slug) }, 'subscribe') }