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', - ); }); diff --git a/resources/locale/en.yml b/resources/locale/en.yml index ba15af3..1ba1dad 100644 --- a/resources/locale/en.yml +++ b/resources/locale/en.yml @@ -24,7 +24,8 @@ ianm-follow-users: user_controls: follow_button: => ianm-follow-users.lib.follow - unfollow_button: => ianm-follow-users.lib.change_follow_type + unfollow_button: => ianm-follow-users.lib.unfollow + change_button: => ianm-follow-users.lib.change_follow_type settings: notify_new_follower_label: Someone follows me @@ -113,6 +114,7 @@ ianm-follow-users: follow: Follow change_follow_type: Change follow type + unfollow: Unfollow follow_levels: unfollow: