Skip to content

Commit

Permalink
Update definition of videopress active
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeyGuyDylan committed Aug 12, 2024
1 parent a2d0ea2 commit b29bb5b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import { Text } from '@automattic/jetpack-components';
import { useCallback } from 'react';
import { PRODUCT_STATUSES } from '../../../constants';
import { PRODUCT_SLUGS } from '../../../data/constants';
import useProduct from '../../../data/products/use-product';
import { getMyJetpackWindowInitialState } from '../../../data/utils/get-my-jetpack-window-state';
Expand All @@ -17,9 +18,12 @@ const slug = PRODUCT_SLUGS.VIDEOPRESS;

const VideopressCard: ProductCardComponent = ( { admin } ) => {
const { detail } = useProduct( slug );
const { isPluginActive = false } = detail || {};
const { status } = detail || {};
const { videopress: data } = getMyJetpackWindowInitialState();

const isPluginActive =
status === PRODUCT_STATUSES.ACTIVE || status === PRODUCT_STATUSES.CAN_UPGRADE;

const descriptionText = useVideoPressCardDescription( {
isPluginActive,
videoCount: data.videoCount,
Expand Down

0 comments on commit b29bb5b

Please sign in to comment.