Check for empty recommended channels.

This commit is contained in:
Gan Eng Chin 2022-12-23 21:19:00 +08:00
parent 2e8b5227e4
commit 4fa4f802e9
No known key found for this signature in database
GPG Key ID: 94D5D972860ADB01
1 changed files with 10 additions and 2 deletions

View File

@ -47,10 +47,18 @@ export const Channels = () => {
/*
* If users have no registered channels,
* we display recommended channels without collapsible list
* we should display recommended channels without collapsible list
* and with a description in the card header.
*/
if ( registeredChannels.length === 0 && recommendedChannels.length > 0 ) {
if ( registeredChannels.length === 0 ) {
/**
* If for some reasons we don't have recommended channels,
* then we should not show the Channels card at all.
*/
if ( recommendedChannels.length === 0 ) {
return null;
}
return (
<Card className="woocommerce-marketing-channels-card">
<CardHeader>