Handle hideCollections

This commit is contained in:
Lim Chee Aun 2024-05-16 21:11:51 +08:00
parent 9934daeb4d
commit b0a53b7fa1
2 changed files with 9 additions and 1 deletions

View file

@ -186,6 +186,7 @@ function AccountInfo({
memorial,
moved,
roles,
hideCollections,
} = info || {};
let headerIsAvatar = false;
let { header, headerStatic } = info || {};
@ -677,6 +678,9 @@ function AccountInfo({
excludeRelationshipAttrs: isSelf
? ['followedBy']
: [],
blankCopy: hideCollections
? 'This user has chosen to not make this information available.'
: undefined,
};
}, 0);
}}
@ -712,6 +716,9 @@ function AccountInfo({
fetchAccounts: fetchFollowing,
instance,
excludeRelationshipAttrs: isSelf ? ['following'] : [],
blankCopy: hideCollections
? 'This user has chosen to not make this information available.'
: undefined,
};
}, 0);
}}

View file

@ -20,6 +20,7 @@ export default function GenericAccounts({
excludeRelationshipAttrs = [],
postID,
onClose = () => {},
blankCopy = 'Nothing to show',
}) {
const { masto, instance: currentInstance } = api();
const isCurrentInstance = instance ? instance === currentInstance : true;
@ -221,7 +222,7 @@ export default function GenericAccounts({
) : uiState === 'error' ? (
<p class="ui-state">Error loading accounts</p>
) : (
<p class="ui-state insignificant">Nothing to show</p>
<p class="ui-state insignificant">{blankCopy}</p>
)}
</main>
</div>