diff --git a/src/onboarding/components/Finish.js b/src/onboarding/components/Finish.js index ceb636621..233f3a5a1 100644 --- a/src/onboarding/components/Finish.js +++ b/src/onboarding/components/Finish.js @@ -23,11 +23,16 @@ const Finish = () => { const [ email, setEmail ] = useState( window.otterOnboardingData?.userEmail ); const [ isLoading, setIsLoading ] = useState( false ); - const { hasUserOptedin } = useSelect( select => { + const { + hasUserOptedin, + currentTheme + } = useSelect( select => { const { get } = select( 'core/preferences' ); + const { getCurrentTheme } = select( 'core' ); return { - hasUserOptedin: get( 'themeisle/otter-blocks', 'onboarding-optin' ) + hasUserOptedin: get( 'themeisle/otter-blocks', 'onboarding-optin' ), + currentTheme: getCurrentTheme()?.template || getCurrentTheme()?.stylesheet }; }, []); @@ -58,7 +63,7 @@ const Finish = () => { 'Cache-Control': 'no-cache' }, body: JSON.stringify({ - slug: 'raft', // We need to see how we can make it work for any themes + slug: currentTheme, site: window.otterOnboardingData.rootUrl, email }) diff --git a/src/onboarding/components/steps/SiteInfo.js b/src/onboarding/components/steps/SiteInfo.js index d582f4bd3..81b41e49b 100644 --- a/src/onboarding/components/steps/SiteInfo.js +++ b/src/onboarding/components/steps/SiteInfo.js @@ -133,9 +133,12 @@ const SiteInfo = () => { const blocks = select( 'core/block-editor' ).getBlocks(); - let siteLogoBlock = findBlock( blocks, 'core/site-logo' ); + const siteLogoBlock = findBlock( blocks, 'core/site-logo' ); + const siteTitleBlock = findBlock( blocks, 'core/site-title' ); - if ( siteLogoBlock ) { + // We only want to replace site logo with site title if site title is not present. + // In themes like Neve FSE, we have both site title and site logo. + if ( siteLogoBlock && ! siteTitleBlock ) { replaceBlock( siteLogoBlock.clientId, wp.blocks.createBlock( 'core/site-title', {