| @@ -1,5 +1,5 @@ | ||
| 1 | -import React, { useEffect, useCallback } from 'react'; | |
| 1 | +import { useEffect, useCallback } from '@wordpress/element'; | |
| 2 | 2 | import { useHistory } from 'react-router-dom'; |
| 3 | 3 | import { __ } from '@wordpress/i18n'; |
| 4 | 4 | import { useStateValue } from '../utils/StateProvider'; |
| 5 | 5 | // import CartFlowsLogo from '@WizardImages/cartflows-logo.svg'; |
| @@ -24,13 +24,15 @@ | ||
| 24 | 24 | button_class: 'wcf-start-setup', |
| 25 | 25 | }, |
| 26 | 26 | } ); |
| 27 | 27 | |
| 28 | - const startOnboardingEvent = document.addEventListener( | |
| 28 | + const startOnboardingEvent = function () { | |
| 29 | + redirectNextStep(); | |
| 30 | + }; | |
| 31 | + | |
| 32 | + document.addEventListener( | |
| 29 | 33 | 'wcf-redirect-page-builder-step', |
| 30 | - function () { | |
| 31 | - redirectNextStep(); | |
| 32 | - }, | |
| 34 | + startOnboardingEvent, | |
| 33 | 35 | false |
| 34 | 36 | ); |
| 35 | 37 | |
| 36 | 38 | return () => { |