From f5c187c2cc8c5cc2ed2607f058112c93f1c78faa Mon Sep 17 00:00:00 2001
From: IanM <16573496+imorland@users.noreply.github.com>
Date: Mon, 12 Feb 2024 08:40:42 +0000
Subject: [PATCH] fix: cannot unfollow user who blocks following (#38)
---
js/src/forum/addFollowControls.js | 23 +++++++++++++++++++++--
resources/locale/en.yml | 4 +++-
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/js/src/forum/addFollowControls.js b/js/src/forum/addFollowControls.js
index 49cb24d..cb59e10 100644
--- a/js/src/forum/addFollowControls.js
+++ b/js/src/forum/addFollowControls.js
@@ -20,10 +20,29 @@ function openFollowLevelModal(user) {
export default function addFollowControls() {
extend(UserControls, 'userControls', function (items, user) {
+ const followingBlockingUser = !user.canBeFollowed() && user.followed();
+ const icon = 'fas fa-user-friends';
+
+ if (followingBlockingUser) {
+ items.add(
+ 'unfollow',
+
+ );
+ }
+
if (
!app.session.user ||
app.session.user === user ||
!user.canBeFollowed() ||
+ followingBlockingUser ||
(app.forum.attribute('ianm-follow-users.button-on-profile') &&
!(app.current.data.routeName === 'fof_user_directory' && app.forum.attribute('userDirectorySmallCards')))
) {
@@ -32,8 +51,8 @@ export default function addFollowControls() {
items.add(
'follow',
-