Disable play/suffle buttons from empty collections.
This commit is contained in:
parent
de825fd4dc
commit
63ce691b90
1 changed files with 3 additions and 0 deletions
|
@ -54,6 +54,7 @@ function CollectionActions(props: Props) {
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
const claimId = claim && claim.claim_id;
|
const claimId = claim && claim.claim_id;
|
||||||
const webShareable = true; // collections have cost?
|
const webShareable = true; // collections have cost?
|
||||||
|
const isEmptyCollection = !firstItem;
|
||||||
|
|
||||||
const doPlay = React.useCallback(
|
const doPlay = React.useCallback(
|
||||||
(playUri) => {
|
(playUri) => {
|
||||||
|
@ -84,6 +85,7 @@ function CollectionActions(props: Props) {
|
||||||
icon={ICONS.PLAY}
|
icon={ICONS.PLAY}
|
||||||
label={__('Play')}
|
label={__('Play')}
|
||||||
title={__('Play')}
|
title={__('Play')}
|
||||||
|
disabled={isEmptyCollection}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
doToggleShuffleList(collectionId, false);
|
doToggleShuffleList(collectionId, false);
|
||||||
doPlay(firstItem);
|
doPlay(firstItem);
|
||||||
|
@ -94,6 +96,7 @@ function CollectionActions(props: Props) {
|
||||||
icon={ICONS.SHUFFLE}
|
icon={ICONS.SHUFFLE}
|
||||||
label={__('Shuffle Play')}
|
label={__('Shuffle Play')}
|
||||||
title={__('Shuffle Play')}
|
title={__('Shuffle Play')}
|
||||||
|
disabled={isEmptyCollection}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
doToggleShuffleList(collectionId, true);
|
doToggleShuffleList(collectionId, true);
|
||||||
setDoShuffle(true);
|
setDoShuffle(true);
|
||||||
|
|
Loading…
Reference in a new issue