Skip to content
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

Just in case | Fail safe checks #502

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -68,7 +68,7 @@
setDrawerActiveView( false );
updateInitialize( true );
setIsHeaderNavigationEnabled( false );
}, [ currentData ] );

Check warning on line 71 in src/OnboardingSPA/steps/SiteGen/Preview/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'setDrawerActiveView', 'setHeaderActiveView', 'setHideFooterNav', 'setIsHeaderEnabled', 'setIsHeaderNavigationEnabled', 'setSidebarActiveView', and 'updateInitialize'. Either include them or remove the dependency array

useEffect( () => {
if (
Expand All @@ -79,7 +79,7 @@
loadGlobalStyles();
}
prevSiteGenErrorStatus.current = siteGenErrorStatus;
}, [ siteGenErrorStatus ] );

Check warning on line 82 in src/OnboardingSPA/steps/SiteGen/Preview/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'loadHomepages'. Either include it or remove the dependency array

const loadHomepages = async () => {
setIsPreviewLoading( true );
Expand Down Expand Up @@ -138,7 +138,7 @@
useEffect( () => {
loadHomepages();
loadGlobalStyles();
}, [] );

Check warning on line 141 in src/OnboardingSPA/steps/SiteGen/Preview/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'loadHomepages'. Either include it or remove the dependency array

const handlePreview = ( slug, position ) => {
if ( ! ( slug in homepages ) ) {
Expand Down Expand Up @@ -245,15 +245,17 @@
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
Loading