diff --git a/routes/_actions/follow.js b/routes/_actions/follow.js index 9f9c1c0..e50f811 100644 --- a/routes/_actions/follow.js +++ b/routes/_actions/follow.js @@ -8,16 +8,17 @@ export async function setAccountFollowed (accountId, follow, toastOnSuccess) { let instanceName = store.get('currentInstance') let accessToken = store.get('accessToken') try { + let account if (follow) { - await followAccount(instanceName, accessToken, accountId) + account = await followAccount(instanceName, accessToken, accountId) } else { - await unfollowAccount(instanceName, accessToken, accountId) + account = await unfollowAccount(instanceName, accessToken, accountId) } await updateProfileAndRelationship(accountId) let relationship = await database.getRelationship(instanceName, accountId) if (toastOnSuccess) { if (follow) { - if (relationship.requested) { + if (account.locked && relationship.requested) { toast.say('Requested to follow account') } else { toast.say('Followed account') diff --git a/routes/_components/AccountProfile.html b/routes/_components/AccountProfile.html index 92815dc..f29ee78 100644 --- a/routes/_components/AccountProfile.html +++ b/routes/_components/AccountProfile.html @@ -1,18 +1,18 @@
tags if (!note.startsWith('
')) {
@@ -220,7 +220,9 @@
return note
},
following: (relationship) => relationship && relationship.following,
- followRequested: (relationship) => relationship && relationship.requested,
+ followRequested: (relationship, account) => {
+ return relationship && relationship.requested && account && account.locked
+ },
followLabel: (following, followRequested) => {
if (following) {
return 'Unfollow'
diff --git a/routes/_pages/accounts/[accountId].html b/routes/_pages/accounts/[accountId].html
index 879a681..2288e17 100644
--- a/routes/_pages/accounts/[accountId].html
+++ b/routes/_pages/accounts/[accountId].html
@@ -1,7 +1,7 @@
{{#if $isUserLoggedIn}}