Skip to content

Commit

Permalink
[TMZ-249] remove messages when running first step of the wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoladj77 committed Dec 16, 2024
1 parent b313ccc commit b585406
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions modules/admin/assets/js/pages/onboarding-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,24 @@ export const OnboardingPage = () => {
try {
switch ( stepAction ) {
case 'install-elementor':
setMessage( __( 'Installing Elementor plugin…', 'hello-plus' ) );
const response = await wp.ajax.post( 'helloplus_setup_wizard', data );

if ( response.activateUrl ) {
setMessage( __( 'Activating Elementor plugin…', 'hello-plus' ) );
const activate = await fetch( response.activateUrl );

if ( activate.ok ) {
setSeverity( 'success' );
setMessage( __( 'Elementor plugin has been installed and activated' ) );
window.location.reload();
} else {
throw new Error( __( 'Failed to activate Elementor plugin', 'hello-plus' ) );
}
}
window.location.reload();
break;
case 'activate-elementor':
setMessage( __( 'Activating Elementor plugin…', 'hello-plus' ) );
await wp.ajax.post( 'helloplus_setup_wizard', data );
data.slug = 'elementor';

window.location.reload();
break;
case 'install-kit':
default:
break;
}
} catch ( error ) {
Expand Down

0 comments on commit b585406

Please sign in to comment.