From 3edb9d47f3adf74342306c0ddeb1f193e57ab2d4 Mon Sep 17 00:00:00 2001 From: Renzo Canepa Date: Fri, 26 Nov 2021 17:22:58 -0300 Subject: [PATCH 1/3] Call fetch modules and settings after successful activation --- projects/plugins/jetpack/_inc/client/main.jsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/projects/plugins/jetpack/_inc/client/main.jsx b/projects/plugins/jetpack/_inc/client/main.jsx index fbfdc8cbbe747..6404a23f413ea 100644 --- a/projects/plugins/jetpack/_inc/client/main.jsx +++ b/projects/plugins/jetpack/_inc/client/main.jsx @@ -21,6 +21,8 @@ import { updateLicensingActivationNoticeDismiss as updateLicensingActivationNoticeDismissAction, updateUserLicensesCounts as updateUserLicensesCountsAction, } from 'state/licensing'; +import { fetchModules as fetchModulesAction } from 'state/modules'; +import { fetchSettings as fetchSettingsAction } from 'state/settings'; import { getSiteConnectionStatus, isCurrentUserLinked, @@ -534,6 +536,10 @@ class Main extends React.Component { this.props.fetchSiteData(); // Update site products. this.props.fetchSitePurchases(); + // Update site modules (search, wordads, google-analytics, etc.) + this.props.fetchModules(); + // Update site settings (i.e. search, instant search, etc.) + this.props.fetchSettings(); } render() { @@ -631,6 +637,12 @@ export default connect( fetchSitePurchases: () => { return dispatch( fetchSitePurchasesAction() ); }, + fetchModules: () => { + return dispatch( fetchModulesAction() ); + }, + fetchSettings: () => { + return dispatch( fetchSettingsAction() ); + }, } ) )( withDispatch( dispatch => { From f3b5f37b41deead0315c254b2d806bbca12b5c1b Mon Sep 17 00:00:00 2001 From: Renzo Canepa Date: Fri, 26 Nov 2021 17:34:40 -0300 Subject: [PATCH 2/3] Add changelog file --- .../add-fetch-settings-modules-after-license-activation | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 projects/plugins/jetpack/changelog/add-fetch-settings-modules-after-license-activation diff --git a/projects/plugins/jetpack/changelog/add-fetch-settings-modules-after-license-activation b/projects/plugins/jetpack/changelog/add-fetch-settings-modules-after-license-activation new file mode 100644 index 0000000000000..791b025e854de --- /dev/null +++ b/projects/plugins/jetpack/changelog/add-fetch-settings-modules-after-license-activation @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +Refresh the site's modules and settings after successful product activation. From bf9630598f60479fdfd022aa66a64f555d987d0d Mon Sep 17 00:00:00 2001 From: Renzo Canepa Date: Fri, 26 Nov 2021 17:45:23 -0300 Subject: [PATCH 3/3] Remove duplicate import --- projects/plugins/jetpack/_inc/client/main.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/plugins/jetpack/_inc/client/main.jsx b/projects/plugins/jetpack/_inc/client/main.jsx index 6404a23f413ea..6d37b2e6f1e8c 100644 --- a/projects/plugins/jetpack/_inc/client/main.jsx +++ b/projects/plugins/jetpack/_inc/client/main.jsx @@ -22,7 +22,6 @@ import { updateUserLicensesCounts as updateUserLicensesCountsAction, } from 'state/licensing'; import { fetchModules as fetchModulesAction } from 'state/modules'; -import { fetchSettings as fetchSettingsAction } from 'state/settings'; import { getSiteConnectionStatus, isCurrentUserLinked, @@ -55,7 +54,11 @@ import { fetchSiteData as fetchSiteDataAction, fetchSitePurchases as fetchSitePurchasesAction, } from 'state/site'; -import { areThereUnsavedSettings, clearUnsavedSettingsFlag } from 'state/settings'; +import { + areThereUnsavedSettings, + clearUnsavedSettingsFlag, + fetchSettings as fetchSettingsAction +} from 'state/settings'; import { getSearchTerm } from 'state/search'; import { Recommendations } from 'recommendations'; import ProductDescriptions from 'product-descriptions';