Enhance Crisp Plugin Configuration Logic

- Updated the Crisp plugin configuration in `crisp.client.js` to prevent initialization when on the public form page. This change introduces a new condition that checks if the current route is the 'forms-slug' page, ensuring that the Crisp chat functionality is only enabled on appropriate pages.

These changes aim to improve the user experience by preventing unnecessary chat interactions on specific pages, thereby streamlining the application behavior.
This commit is contained in:
JhumanJ 2025-05-19 15:16:33 +02:00
parent c17f4776bc
commit 96786215aa
1 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,9 @@ import { Crisp } from "crisp-sdk-web"
export default defineNuxtPlugin(() => { export default defineNuxtPlugin(() => {
const isIframe = useIsIframe() const isIframe = useIsIframe()
const crispWebsiteId = useRuntimeConfig().public.crispWebsiteId const crispWebsiteId = useRuntimeConfig().public.crispWebsiteId
if (crispWebsiteId && !isIframe) { const isPublicFormPage = useRoute().name === 'forms-slug'
if (crispWebsiteId && !isIframe && !isPublicFormPage) {
Crisp.configure(crispWebsiteId) Crisp.configure(crispWebsiteId)
window.Crisp = Crisp window.Crisp = Crisp
} }