fixed the fix

Previous fix did not take into account "unfollow". Now it does
This commit is contained in:
Mario Siqueira 2020-03-26 17:56:10 -03:00 committed by GitHub
parent a5ae700b92
commit 2c86eb5cf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -631,21 +631,22 @@ exports.authorView = ({
relationship.following === true &&
relationship.blocking === false;
const contactFormType = areFollowing ? i18n.unfollow : i18n.follow;
const contactFormType = areFollowing ? 'unfollow' : 'follow';
const contactFormTypeLabel = areFollowing ? i18n.unfollow : i18n.follow;
const contactForm =
relationship === null
? null // We're on our own profile!
: form(
{
action: `/follow/${encodeURIComponent(feedId)}`,
action: `/${contactFormType}/${encodeURIComponent(feedId)}`,
method: "post",
},
button(
{
type: "submit",
},
contactFormType
contactFormTypeLabel
)
);