diff --git a/src/pages/pods/Homepod.tsx b/src/pages/pods/Homepod.tsx index cbaf9f5..162f6f3 100644 --- a/src/pages/pods/Homepod.tsx +++ b/src/pages/pods/Homepod.tsx @@ -1,22 +1,13 @@ import { H3, Eyebrow, P } from "@/components/Texts" import { Button } from "@/components/Button" -import React from 'react'; - -// NOTE: Ensure your global types file (global.d.ts) is set up -// to avoid TypeScript errors on window.ml_account export default function Homepod() { const onGetStartedClick = () => { - // 1. Ensure we are in a browser environment (client-side) - // and the ml_account function is available globally. - if (typeof window !== 'undefined' && window.ml_account) { - - // 2. Execute the MailerLite pop-up trigger function using the specific snippet you provided. - // TypeScript is happy if you defined the global type in step 1. - window.ml_account('webforms', '6108375', 'l9m8g1', 'show'); - + // Ensure we are in a browser environment and ml_account exists before calling it + if (typeof window !== 'undefined' && typeof (window as any).ml_account === 'function') { + (window as any).ml_account('webforms', '6108375', 'l9m8g1', 'show') } else { - console.log("MailerLite script (ml_account) not fully loaded or not in browser."); + console.log("MailerLite script (ml_account) not fully loaded or not in browser.") } };