about summary refs log tree commit diff
path: root/app/javascript/mastodon/selectors/index.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-05-10 09:44:35 +0200
committerGitHub <noreply@github.com>2022-05-10 09:44:35 +0200
commitb4d373a3df2752d9f8bdc0d7f02350528f3789b2 (patch)
treeb093d14cf34baa0e729be2376d168a9a3527f320 /app/javascript/mastodon/selectors/index.js
parent898fe2fa8e886d62de2bd9b15eb758054216d33d (diff)
Add `limited` attribute to accounts in REST API and a warning in web UI (#18344)
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);
+});