Do not show shuffle option for empty collections.
This commit is contained in:
parent
63ce691b90
commit
6108860063
1 changed files with 19 additions and 12 deletions
|
@ -110,6 +110,11 @@ function ClaimMenuList(props: Props) {
|
||||||
const [doShuffle, setDoShuffle] = React.useState(false);
|
const [doShuffle, setDoShuffle] = React.useState(false);
|
||||||
const incognitoClaim = contentChannelUri && !contentChannelUri.includes('@');
|
const incognitoClaim = contentChannelUri && !contentChannelUri.includes('@');
|
||||||
const isChannel = !incognitoClaim && !contentSigningChannel;
|
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 { channelName } = parseURI(contentChannelUri);
|
||||||
const showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0));
|
const showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0));
|
||||||
const subscriptionLabel = repostedClaim
|
const subscriptionLabel = repostedClaim
|
||||||
|
@ -297,18 +302,20 @@ function ClaimMenuList(props: Props) {
|
||||||
{__('View List')}
|
{__('View List')}
|
||||||
</a>
|
</a>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
{!isEmptyCollection && (
|
||||||
className="comment__menu-option"
|
<MenuItem
|
||||||
onSelect={() => {
|
className="comment__menu-option"
|
||||||
if (!resolvedList) fetchItems();
|
onSelect={() => {
|
||||||
setDoShuffle(true);
|
if (!resolvedList) fetchItems();
|
||||||
}}
|
setDoShuffle(true);
|
||||||
>
|
}}
|
||||||
<div className="menu__link">
|
>
|
||||||
<Icon aria-hidden icon={ICONS.SHUFFLE} />
|
<div className="menu__link">
|
||||||
{__('Shuffle Play')}
|
<Icon aria-hidden icon={ICONS.SHUFFLE} />
|
||||||
</div>
|
{__('Shuffle Play')}
|
||||||
</MenuItem>
|
</div>
|
||||||
|
</MenuItem>
|
||||||
|
)}
|
||||||
{isMyCollection && (
|
{isMyCollection && (
|
||||||
<>
|
<>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
|
|
Loading…
Reference in a new issue