Skip to content

Commit

Permalink
fix: only reference mktoForms2 when available
Browse files Browse the repository at this point in the history
zstix committed Sep 23, 2020

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent f3b6209 commit 041277c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -41,10 +41,12 @@ const onInitialClientRender = () => {
}
}

// eslint-disable-next-line no-undef
MktoForms2.whenRendered(function (form) {
destyleMktoForm(form);
});
if (typeof window !== 'undefined' && window.MktoForms2) {
// eslint-disable-next-line no-undef
MktoForms2.whenRendered(function (form) {
destyleMktoForm(form);
});
}
};

const onRouteUpdate = ({ location }) => {

0 comments on commit 041277c

Please sign in to comment.