Skip to content

Commit

Permalink
chore: display zendesk widget on founders page
Browse files Browse the repository at this point in the history
  • Loading branch information
shelegdmitriy committed Feb 22, 2024
1 parent 13cd432 commit c18464f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) {
useEffect(() => {
// Displays the Zendesk widget only if user is signed in and on the home page
if (!window.zE) return;
if (!signedIn || Boolean(componentSrc?.componentAccountId && componentSrc?.componentName)) {
if (
(!signedIn || Boolean(componentSrc?.componentAccountId && componentSrc?.componentName)) &&
!router.route.startsWith('/founders')
) {
window.zE('webWidget', 'hide');
return;
}
localStorage.setItem('accountId', accountId);
window.zE('webWidget', 'show');
}, [accountId, signedIn, componentSrc]);
}, [accountId, signedIn, componentSrc, router.route]);

useEffect(() => {
const interval = setInterval(zendeskCheck, 20);
Expand Down

0 comments on commit c18464f

Please sign in to comment.