Skip to content

Commit

Permalink
Refresh the site's modules and settings after successful product acti…
Browse files Browse the repository at this point in the history
…vation (#21886)

* Call fetch modules and settings after successful activation

* Add changelog file

* Remove duplicate import

Co-authored-by: Samiff <samiff@users.noreply.github.com>
  • Loading branch information
rcanepa and samiff committed Nov 29, 2021
1 parent ed4b1e0 commit 851be38
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
17 changes: 16 additions & 1 deletion projects/plugins/jetpack/_inc/client/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
updateLicensingActivationNoticeDismiss as updateLicensingActivationNoticeDismissAction,
updateUserLicensesCounts as updateUserLicensesCountsAction,
} from 'state/licensing';
import { fetchModules as fetchModulesAction } from 'state/modules';
import {
getSiteConnectionStatus,
isCurrentUserLinked,
Expand Down Expand Up @@ -55,7 +56,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';
Expand Down Expand Up @@ -576,6 +581,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() {
Expand Down Expand Up @@ -674,6 +683,12 @@ export default connect(
fetchSitePurchases: () => {
return dispatch( fetchSitePurchasesAction() );
},
fetchModules: () => {
return dispatch( fetchModulesAction() );
},
fetchSettings: () => {
return dispatch( fetchSettingsAction() );
},
} )
)(
withDispatch( dispatch => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Refresh the site's modules and settings after successful product activation.

0 comments on commit 851be38

Please sign in to comment.