From d448277bbe27a459ab0d894be9ee85c02993951e Mon Sep 17 00:00:00 2001 From: Sean King Date: Sat, 24 Oct 2020 21:44:22 -0600 Subject: [PATCH 1/2] Message when a profile is blocked changed --- app/soapbox/features/account_timeline/index.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/soapbox/features/account_timeline/index.js b/app/soapbox/features/account_timeline/index.js index 21a55181b..7f0e12114 100644 --- a/app/soapbox/features/account_timeline/index.js +++ b/app/soapbox/features/account_timeline/index.js @@ -39,11 +39,12 @@ const mapStateToProps = (state, { params: { username }, withReplies = false }) = const path = withReplies ? `${accountId}:with_replies` : accountId; const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false); - const unavailable = (me === accountId) ? false : isBlocked; + const unavailable = (me === accountId) ? false : true; return { accountId, unavailable, + isBlocked, accountUsername, accountApId, isAccount: !!state.getIn(['accounts', accountId]), @@ -117,7 +118,7 @@ class AccountTimeline extends ImmutablePureComponent { } render() { - const { statusIds, featuredStatusIds, isLoading, hasMore, isAccount, accountId, unavailable, accountUsername } = this.props; + const { statusIds, featuredStatusIds, isLoading, hasMore, isAccount, accountId, isBlocked, unavailable, accountUsername } = this.props; if (!isAccount && accountId !== -1) { return ( @@ -135,6 +136,16 @@ class AccountTimeline extends ImmutablePureComponent { ); } + if (isBlocked) { + return ( + +
+ +
+
+ ); + } + if (unavailable) { return ( From 3d393deee4ba97d6f11ed77c43ff2709fd7acdf9 Mon Sep 17 00:00:00 2001 From: Sean King Date: Mon, 2 Nov 2020 08:25:21 -0700 Subject: [PATCH 2/2] A better way to handle block messages --- app/soapbox/features/account_timeline/index.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/app/soapbox/features/account_timeline/index.js b/app/soapbox/features/account_timeline/index.js index 7f0e12114..94762c918 100644 --- a/app/soapbox/features/account_timeline/index.js +++ b/app/soapbox/features/account_timeline/index.js @@ -39,7 +39,7 @@ const mapStateToProps = (state, { params: { username }, withReplies = false }) = const path = withReplies ? `${accountId}:with_replies` : accountId; const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false); - const unavailable = (me === accountId) ? false : true; + const unavailable = (me === accountId) ? false : isBlocked; return { accountId, @@ -136,21 +136,12 @@ class AccountTimeline extends ImmutablePureComponent { ); } - if (isBlocked) { - return ( - -
- -
-
- ); - } - if (unavailable) { return (
- + {isBlocked ? + : }
);