diff --git a/app/javascript/flavours/glitch/api_types/accounts.ts b/app/javascript/flavours/glitch/api_types/accounts.ts
index 3347a970fb3..5bf3e64288c 100644
--- a/app/javascript/flavours/glitch/api_types/accounts.ts
+++ b/app/javascript/flavours/glitch/api_types/accounts.ts
@@ -43,4 +43,5 @@ export interface ApiAccountJSON {
suspended?: boolean;
limited?: boolean;
memorial?: boolean;
+ hide_collections: boolean;
}
diff --git a/app/javascript/flavours/glitch/features/followers/index.jsx b/app/javascript/flavours/glitch/features/followers/index.jsx
index 6226c96f219..2ea3574a901 100644
--- a/app/javascript/flavours/glitch/features/followers/index.jsx
+++ b/app/javascript/flavours/glitch/features/followers/index.jsx
@@ -45,6 +45,7 @@ const mapStateToProps = (state, { params: { acct, id } }) => {
hasMore: !!state.getIn(['user_lists', 'followers', accountId, 'next']),
isLoading: state.getIn(['user_lists', 'followers', accountId, 'isLoading'], true),
suspended: state.getIn(['accounts', accountId, 'suspended'], false),
+ hideCollections: state.getIn(['accounts', accountId, 'hide_collections'], false),
hidden: getAccountHidden(state, accountId),
};
};
@@ -117,7 +118,7 @@ class Followers extends ImmutablePureComponent {
};
render () {
- const { accountId, accountIds, hasMore, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl } = this.props;
+ const { accountId, accountIds, hasMore, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl, hideCollections } = this.props;
if (!isAccount) {
return (
@@ -141,6 +142,8 @@ class Followers extends ImmutablePureComponent {
emptyMessage = ;
} else if (hidden) {
emptyMessage = ;
+ } else if (hideCollections && accountIds.isEmpty()) {
+ emptyMessage = ;
} else if (remote && accountIds.isEmpty()) {
emptyMessage = ;
} else {
diff --git a/app/javascript/flavours/glitch/features/following/index.jsx b/app/javascript/flavours/glitch/features/following/index.jsx
index 69936343028..0d18e76ec4e 100644
--- a/app/javascript/flavours/glitch/features/following/index.jsx
+++ b/app/javascript/flavours/glitch/features/following/index.jsx
@@ -45,6 +45,7 @@ const mapStateToProps = (state, { params: { acct, id } }) => {
hasMore: !!state.getIn(['user_lists', 'following', accountId, 'next']),
isLoading: state.getIn(['user_lists', 'following', accountId, 'isLoading'], true),
suspended: state.getIn(['accounts', accountId, 'suspended'], false),
+ hideCollections: state.getIn(['accounts', accountId, 'hide_collections'], false),
hidden: getAccountHidden(state, accountId),
};
};
@@ -117,7 +118,7 @@ class Following extends ImmutablePureComponent {
};
render () {
- const { accountId, accountIds, hasMore, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl } = this.props;
+ const { accountId, accountIds, hasMore, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl, hideCollections } = this.props;
if (!isAccount) {
return (
@@ -141,6 +142,8 @@ class Following extends ImmutablePureComponent {
emptyMessage = ;
} else if (hidden) {
emptyMessage = ;
+ } else if (hideCollections && accountIds.isEmpty()) {
+ emptyMessage = ;
} else if (remote && accountIds.isEmpty()) {
emptyMessage = ;
} else {
diff --git a/app/javascript/flavours/glitch/models/account.ts b/app/javascript/flavours/glitch/models/account.ts
index 8500009e0f2..0b698ead3d1 100644
--- a/app/javascript/flavours/glitch/models/account.ts
+++ b/app/javascript/flavours/glitch/models/account.ts
@@ -94,6 +94,7 @@ export const accountDefaultValues: AccountShape = {
memorial: false,
limited: false,
moved: null,
+ hide_collections: false,
};
const AccountFactory = ImmutableRecord(accountDefaultValues);