diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-05-10 09:44:35 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-05-11 11:59:08 +0200 |
commit | 6fb837aa1d34fbafda1fe561d1a3789ac281d27c (patch) | |
tree | d7143f63d6fc7d0d6d817d61f2fcc335fe4aba7a /app/javascript/flavours/glitch/selectors | |
parent | bb1a3e902d5a8ecd3bc5cd6bf136f52d6eaf70f8 (diff) |
[Glitch] Add `limited` attribute to accounts in REST API and a warning in web UI
Port b4d373a3df2752d9f8bdc0d7f02350528f3789b2 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/selectors')
-rw-r--r-- | app/javascript/flavours/glitch/selectors/index.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/selectors/index.js b/app/javascript/flavours/glitch/selectors/index.js index bb9180d12..99afe5355 100644 --- a/app/javascript/flavours/glitch/selectors/index.js +++ b/app/javascript/flavours/glitch/selectors/index.js @@ -194,3 +194,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); +}); |