Do a refresh when redirecting to homescreen after OBW to ensure inbox notifications show. (https://github.com/woocommerce/woocommerce-admin/pull/5547)

This commit is contained in:
Sam Seay 2020-11-07 08:52:57 +13:00 committed by GitHub
parent 17b7fc0f1f
commit 536f426525
1 changed files with 10 additions and 4 deletions

View File

@ -234,20 +234,26 @@ class ProfileWizard extends Component {
updateProfileItems( { completed: true } ).then( () => {
clearTaskCache();
const homescreenUrl = new URL(
getNewPath( {}, '/', {} ),
window.location.href
).href;
if ( shouldConnectJetpack ) {
document.body.classList.add( 'woocommerce-admin-is-loading' );
connectToJetpack(
getHistory().push( getNewPath( {}, '/', {} ) )
);
connectToJetpack( () => {
return homescreenUrl;
} );
} else {
getHistory().push( getNewPath( {}, '/', {} ) );
window.location.href = homescreenUrl;
}
} );
}
skipProfiler() {
const { createNotice, updateProfileItems } = this.props;
updateProfileItems( { skipped: true } )
.then( () => {
recordEvent( 'storeprofiler_store_details_skip' );