Make data undefined on first load in useRecommendedChannels.
This commit is contained in:
parent
316aad8b2e
commit
49032b98db
|
@ -16,7 +16,7 @@ import {
|
|||
|
||||
type UseRecommendedChannels = {
|
||||
loading: boolean;
|
||||
data: Array< RecommendedChannel >;
|
||||
data?: Array< RecommendedChannel >;
|
||||
};
|
||||
|
||||
export const useRecommendedChannels = (): UseRecommendedChannels => {
|
||||
|
@ -33,13 +33,11 @@ export const useRecommendedChannels = (): UseRecommendedChannels => {
|
|||
* Recommended channels that are not in "active" state,
|
||||
* i.e. channels that are not installed or not activated yet.
|
||||
*/
|
||||
const nonActiveRecommendedChannels = differenceWith(
|
||||
data,
|
||||
activePlugins,
|
||||
( a, b ) => {
|
||||
const nonActiveRecommendedChannels =
|
||||
data &&
|
||||
differenceWith( data, activePlugins, ( a, b ) => {
|
||||
return a.product === b;
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
return {
|
||||
loading: ! hasFinishedResolution( 'getRecommendedChannels' ),
|
||||
|
|
Loading…
Reference in New Issue