about summary refs log tree commit diff
path: root/app/javascript/mastodon/selectors/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/mastodon/selectors/index.js')
-rw-r--r--app/javascript/mastodon/selectors/index.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/javascript/mastodon/selectors/index.js b/app/javascript/mastodon/selectors/index.js
index 1e19db65d..3121774b3 100644
--- a/app/javascript/mastodon/selectors/index.js
+++ b/app/javascript/mastodon/selectors/index.js
@@ -175,3 +175,11 @@ export const getAccountGallery = createSelector([
 
   return medias;
 });
+
+export const getAccountHidden = createSelector([
+  (state, id) => state.getIn(['accounts', id, 'hidden']),
+  (state, id) => state.getIn(['relationships', id, 'following']) || state.getIn(['relationships', id, 'requested']),
+  (state, id) => id === me,
+], (hidden, followingOrRequested, isSelf) => {
+  return hidden && !(isSelf || followingOrRequested);
+});