Do not show shuffle option for empty collections.

This commit is contained in:
Franco Montenegro 2022-05-04 12:20:06 -03:00 committed by jessopb
parent 63ce691b90
commit 6108860063

View file

@ -110,6 +110,11 @@ function ClaimMenuList(props: Props) {
const [doShuffle, setDoShuffle] = React.useState(false);
const incognitoClaim = contentChannelUri && !contentChannelUri.includes('@');
const isChannel = !incognitoClaim && !contentSigningChannel;
// $FlowFixMe
const claimLength = claim && claim.value && claim.value.claims && claim.value.claims.length;
// $FlowFixMe
const claimCount = editedCollection ? editedCollection.items.length : claimLength;
const isEmptyCollection = (Number(claimCount) || 0) <= 0;
const { channelName } = parseURI(contentChannelUri);
const showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0));
const subscriptionLabel = repostedClaim
@ -297,6 +302,7 @@ function ClaimMenuList(props: Props) {
{__('View List')}
</a>
</MenuItem>
{!isEmptyCollection && (
<MenuItem
className="comment__menu-option"
onSelect={() => {
@ -309,6 +315,7 @@ function ClaimMenuList(props: Props) {
{__('Shuffle Play')}
</div>
</MenuItem>
)}
{isMyCollection && (
<>
<MenuItem