diff --git a/src/boot/fathom.ts b/src/boot/fathom.ts index b9b95f9e..1e0e46b7 100644 --- a/src/boot/fathom.ts +++ b/src/boot/fathom.ts @@ -1,19 +1,21 @@ import { boot } from 'quasar/wrappers'; -import { getChain } from 'src/config/ConfigManager'; - +import { useNetworksStore } from 'src/stores/networks'; declare const fathom: { trackEvent: (eventName: string) => void }; export default boot(({ app }) => { - const siteID = getChain().getFathomSiteId(); - if (siteID) { - const script = document.createElement('script'); - script.src = 'https://cdn.usefathom.com/script.js'; - script.dataset.site = siteID; - script.dataset.spa = 'auto'; - script.defer = true; - script.onload = () => { - app.config.globalProperties.$fathom = fathom; - }; - document.body.appendChild(script); + const networksStore = useNetworksStore(); + if (networksStore.currentNetworkName !== '') { + const siteID = networksStore.getCurrentNetwork.getFathomSiteId(); + if (siteID) { + const script = document.createElement('script'); + script.src = 'https://cdn.usefathom.com/script.js'; + script.dataset.site = siteID; + script.dataset.spa = 'auto'; + script.defer = true; + script.onload = () => { + app.config.globalProperties.$fathom = fathom; + }; + document.body.appendChild(script); + } } });