Skip to content

Commit

Permalink
Merge pull request #502 from newfold-labs/enhance/add-fail-safe-checks
Browse files Browse the repository at this point in the history
Just in case | Fail safe checks
  • Loading branch information
diwanshuster authored Mar 4, 2024
2 parents 6836f95 + 1683701 commit 2885f00
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/OnboardingSPA/steps/SiteGen/Preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,17 @@ const SiteGenPreview = () => {
const newPreviewSettings = cloneDeep( globalStyles[ 0 ] );
newPreviewSettings.settings.color.palette = data.color.palette;
const body =
data.styles?.blocks[ 0 ]?.[ 'core/body' ].typography.fontFamily;
data.styles?.blocks[ 0 ]?.[ 'core/body' ]?.typography
?.fontFamily;
const headings =
data.styles?.blocks[ 0 ]?.[ 'core/heading' ].typography
.fontFamily;
if ( newPreviewSettings.styles.typography ) {
data.styles?.blocks[ 0 ]?.[ 'core/heading' ]?.typography
?.fontFamily;
if ( newPreviewSettings.styles.typography && body ) {
newPreviewSettings.styles.typography.fontFamily = body;
}
if (
newPreviewSettings.styles.blocks[ 'core/heading' ].typography
newPreviewSettings.styles.blocks[ 'core/heading' ].typography &&
headings
) {
newPreviewSettings.styles.blocks[
'core/heading'
Expand Down

0 comments on commit 2885f00

Please sign in to comment.