-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue with onboarding in AI branch #428
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,7 +101,7 @@ | |
select( nfdOnboardingStore ).getPluginInstallHash(), | ||
}; | ||
}, | ||
[ location.pathname ] | ||
); | ||
|
||
const [ isRequestPlaced, setIsRequestPlaced ] = useState( false ); | ||
|
@@ -334,7 +334,9 @@ | |
|
||
if ( lastChapter !== currentChapter ) { | ||
if ( lastChapter ) { | ||
currentData.data.chapters[ lastChapter ].completed = true; | ||
if ( currentData.data.chapters[ lastChapter ] ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason why |
||
currentData.data.chapters[ lastChapter ].completed = true; | ||
} | ||
trackOnboardingEvent( | ||
new OnboardingEvent( | ||
ACTION_ONBOARDING_CHAPTER_COMPLETE, | ||
|
@@ -344,7 +346,11 @@ | |
} | ||
|
||
if ( currentChapter ) { | ||
currentData.data.chapters[ currentChapter ].completed = false; | ||
if ( currentData.data.chapters[ currentChapter ] ) { | ||
currentData.data.chapters[ | ||
currentChapter | ||
].completed = false; | ||
} | ||
trackOnboardingEvent( | ||
new OnboardingEvent( | ||
ACTION_ONBOARDING_CHAPTER_STARTED, | ||
|
@@ -364,7 +370,7 @@ | |
|
||
useEffect( () => { | ||
trackChapters(); | ||
}, [ currentStep ] ); | ||
|
||
const prioritizeFlow = () => { | ||
const currentFlow = window.nfdOnboarding.currentFlow; | ||
|
@@ -405,13 +411,13 @@ | |
initializeSettings(); | ||
setInterval( cronTrigger, 45000 ); | ||
} | ||
}, [ initialize ] ); | ||
|
||
useEffect( () => { | ||
if ( false !== brandConfig?.prioritization ) { | ||
return prioritizeFlow(); | ||
} | ||
}, [ experienceLevel, topPriority ] ); | ||
Check warning on line 420 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js GitHub Actions / Run Lint Checks
|
||
|
||
useEffect( () => { | ||
document.body.classList.add( `nfd-brand-${ newfoldBrand }` ); | ||
|
@@ -421,7 +427,7 @@ | |
syncStoreToDB(); | ||
handlePreviousStepTracking(); | ||
handleConditionalDesignStepsRoutes(); | ||
}, [ location.pathname, onboardingFlow ] ); | ||
Check warning on line 430 in src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js GitHub Actions / Run Lint Checks
|
||
|
||
const isForkStep = | ||
currentStep === stepTheFork || | ||
|
@@ -434,28 +440,35 @@ | |
isForkStep | ||
); | ||
|
||
return ( | ||
<ThemeProvider> | ||
<ThemedNewfoldInterfaceSkeleton | ||
className={ classNames( | ||
'nfd-onboarding-skeleton', | ||
`brand-${ newfoldBrand }`, | ||
`path-${ pathname }`, | ||
{ 'is-drawer-open': isDrawerOpen }, | ||
{ 'is-large-viewport': isLargeViewport }, | ||
{ 'is-small-viewport': ! isLargeViewport }, | ||
{ | ||
'nfd-onboarding-skeleton--sitegen': isForkStep, | ||
} | ||
) } | ||
header={ <Header /> } | ||
drawer={ <Drawer /> } | ||
content={ <Content /> } | ||
sidebar={ <Sidebar /> } | ||
footer={ isForkStep ? <Footer /> : null } | ||
/> | ||
</ThemeProvider> | ||
); | ||
const commonSkeletonProps = { | ||
className: classNames( | ||
'nfd-onboarding-skeleton', | ||
`brand-${ newfoldBrand }`, | ||
`path-${ pathname }`, | ||
{ 'is-drawer-open': isDrawerOpen }, | ||
{ 'is-large-viewport': isLargeViewport }, | ||
{ 'is-small-viewport': ! isLargeViewport }, | ||
{ 'nfd-onboarding-skeleton--sitegen': isForkStep } | ||
), | ||
header: <Header />, | ||
drawer: <Drawer />, | ||
content: <Content />, | ||
sidebar: <Sidebar />, | ||
footer: isForkStep ? <Footer /> : null, | ||
}; | ||
|
||
const renderSkeleton = ( Component ) => | ||
isForkStep ? ( | ||
<ThemeProvider> | ||
<Component { ...commonSkeletonProps } /> | ||
</ThemeProvider> | ||
) : ( | ||
<Component { ...commonSkeletonProps } /> | ||
); | ||
|
||
return isForkStep | ||
? renderSkeleton( ThemedNewfoldInterfaceSkeleton ) | ||
: renderSkeleton( NewfoldInterfaceSkeleton ); | ||
}; | ||
|
||
export default SiteBuild; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.