From 9becfd0e389bcff1b89d4f080faf65a9b7ec4bfe Mon Sep 17 00:00:00 2001 From: Rodri Sanchez Date: Thu, 9 Feb 2023 22:26:02 -0300 Subject: [PATCH] Rename refresh purchase function --- .../Settings/Subscribe/Subscribe.component.js | 12 ++++++++---- .../Settings/Subscribe/Subscribe.container.js | 6 +++--- .../SubscriptionProvider.actions.js | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/Settings/Subscribe/Subscribe.component.js b/src/components/Settings/Subscribe/Subscribe.component.js index 21b5c8ec5..5676a4483 100644 --- a/src/components/Settings/Subscribe/Subscribe.component.js +++ b/src/components/Settings/Subscribe/Subscribe.component.js @@ -56,9 +56,9 @@ const propTypes = { */ email: PropTypes.string.isRequired, /** - * Handle update store + * Handle refresh subscription */ - onUpdateStore: PropTypes.func + onRefreshSubscription: PropTypes.func }; const defaultProps = { @@ -77,7 +77,7 @@ const Subscribe = ({ onSubmitPeople, products, subscription, - onUpdateStore + onRefreshSubscription }) => { const renderIncludedFeatures = () => { return INCLUDED_FEATURES.map(feature => { @@ -193,7 +193,11 @@ const Subscribe = ({ productStatus === NOT_SUBSCRIBED || productStatus === ERROR ? ( '' ) : ( - ) diff --git a/src/components/Settings/Subscribe/Subscribe.container.js b/src/components/Settings/Subscribe/Subscribe.container.js index f99cf9c02..4a1e6ca98 100644 --- a/src/components/Settings/Subscribe/Subscribe.container.js +++ b/src/components/Settings/Subscribe/Subscribe.container.js @@ -78,10 +78,10 @@ export class SubscribeContainer extends PureComponent { handleSubmit = async () => {}; - handleUpdateStore = () => { + handleRefreshSubscription = () => { const { comprobeSubscription } = this.props; - window.CdvPurchase.store.update(); + window.CdvPurchase.store.restorePurchases(); comprobeSubscription(); }; @@ -178,7 +178,7 @@ export class SubscribeContainer extends PureComponent { products={this.state.products} subscription={this.props.subscription} updateSubscriberId={this.props.updateSubscriberId} - onUpdateStore={this.handleUpdateStore} + onRefreshSubscription={this.handleRefreshSubscription} /> ); } diff --git a/src/providers/SubscriptionProvider/SubscriptionProvider.actions.js b/src/providers/SubscriptionProvider/SubscriptionProvider.actions.js index 0ce66e2ac..0811809c9 100644 --- a/src/providers/SubscriptionProvider/SubscriptionProvider.actions.js +++ b/src/providers/SubscriptionProvider/SubscriptionProvider.actions.js @@ -61,7 +61,7 @@ export function comprobeSubscription(payload) { : expiryDateFormat; if (isExpired) { - window.CdvPurchase.store.update(); + window.CdvPurchase.store.restorePurchases(); const isBillingRetryPeriodFinished = () => { console.log(