From 63ce691b90ba606ea9975025b7ec4e083dcc417d Mon Sep 17 00:00:00 2001 From: Franco Montenegro Date: Wed, 4 May 2022 11:23:28 -0300 Subject: [PATCH] Disable play/suffle buttons from empty collections. --- ui/component/collectionActions/view.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/component/collectionActions/view.jsx b/ui/component/collectionActions/view.jsx index 442d2e05b..423f851b0 100644 --- a/ui/component/collectionActions/view.jsx +++ b/ui/component/collectionActions/view.jsx @@ -54,6 +54,7 @@ function CollectionActions(props: Props) { const isMobile = useIsMobile(); const claimId = claim && claim.claim_id; const webShareable = true; // collections have cost? + const isEmptyCollection = !firstItem; const doPlay = React.useCallback( (playUri) => { @@ -84,6 +85,7 @@ function CollectionActions(props: Props) { icon={ICONS.PLAY} label={__('Play')} title={__('Play')} + disabled={isEmptyCollection} onClick={() => { doToggleShuffleList(collectionId, false); doPlay(firstItem); @@ -94,6 +96,7 @@ function CollectionActions(props: Props) { icon={ICONS.SHUFFLE} label={__('Shuffle Play')} title={__('Shuffle Play')} + disabled={isEmptyCollection} onClick={() => { doToggleShuffleList(collectionId, true); setDoShuffle(true);