Skip to content

Commit

Permalink
fix(wp5.9): undefined checking for stripe store
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Aug 16, 2023
1 parent ccae01a commit e72846d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/blocks/blocks/stripe-checkout/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ const Edit = ({
value: product?.id
};
}) : [],
hasProductsRequestFailed: Boolean( getResolutionError( 'getStripeProducts' ) ),
productsError: getResolutionError( 'getStripeProducts' ),
isLoadingProducts: isResolving( 'getStripeProducts' )
hasProductsRequestFailed: Boolean( getResolutionError?.( 'getStripeProducts' ) ),
productsError: getResolutionError?.( 'getStripeProducts' ),
isLoadingProducts: isResolving?.( 'getStripeProducts' )
};
}, [ canRetrieveProducts, status ]);

Expand All @@ -119,7 +119,7 @@ const Edit = ({
isResolving: Function
} = select( 'themeisle-gutenberg/data' );

const prices = attributes.product ? getStripeProductPrices( attributes.product ) : [];
const prices = attributes.product ? getStripeProductPrices?.( attributes.product ) : [];

return {
prices,
Expand All @@ -129,9 +129,9 @@ const Edit = ({
value: prices?.id
};
}) : [],
hasPricesRequestFailed: Boolean( getResolutionError( 'getStripeProductPrices', [ attributes.product ]) ),
pricesError: getResolutionError( 'getStripeProductPrices', [ attributes.product ]),
isLoadingPrices: isResolving( 'getStripeProductPrices', [ attributes.product ])
hasPricesRequestFailed: Boolean( getResolutionError?.( 'getStripeProductPrices', [ attributes.product ]) ),
pricesError: getResolutionError?.( 'getStripeProductPrices', [ attributes.product ]),
isLoadingPrices: isResolving?.( 'getStripeProductPrices', [ attributes.product ])
};
}, [ attributes.product, canRetrieveProducts ]);

Expand Down

0 comments on commit e72846d

Please sign in to comment.