diff --git a/routes/_actions/accounts.js b/routes/_actions/accounts.js index e7cf7d3..471e388 100644 --- a/routes/_actions/accounts.js +++ b/routes/_actions/accounts.js @@ -39,11 +39,14 @@ async function updateRelationship (accountId, instanceName, accessToken) { } } -export async function updateProfileAndRelationship (accountId) { +export async function clearProfileAndRelationship () { store.set({ currentAccountProfile: null, currentAccountRelationship: null }) +} + +export async function updateProfileAndRelationship (accountId) { let instanceName = store.get('currentInstance') let accessToken = store.get('accessToken') diff --git a/routes/_actions/follow.js b/routes/_actions/follow.js index 1f7fb7c..e50f811 100644 --- a/routes/_actions/follow.js +++ b/routes/_actions/follow.js @@ -14,8 +14,6 @@ export async function setAccountFollowed (accountId, follow, toastOnSuccess) { } else { account = await unfollowAccount(instanceName, accessToken, accountId) } - // TODO: hack to let the animation fully play - await new Promise(resolve => setTimeout(resolve, 400)) await updateProfileAndRelationship(accountId) let relationship = await database.getRelationship(instanceName, accountId) if (toastOnSuccess) { diff --git a/routes/_components/profile/AccountProfileFollow.html b/routes/_components/profile/AccountProfileFollow.html index f1529db..a61b3fd 100644 --- a/routes/_components/profile/AccountProfileFollow.html +++ b/routes/_components/profile/AccountProfileFollow.html @@ -1,20 +1,22 @@ -