From 96786215aa694e233abfa29a3c739bfde3a7ddf7 Mon Sep 17 00:00:00 2001 From: JhumanJ Date: Mon, 19 May 2025 15:16:33 +0200 Subject: [PATCH] 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. --- client/plugins/crisp.client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/plugins/crisp.client.js b/client/plugins/crisp.client.js index a7d8cbf3..327f9e4d 100644 --- a/client/plugins/crisp.client.js +++ b/client/plugins/crisp.client.js @@ -3,7 +3,9 @@ import { Crisp } from "crisp-sdk-web" export default defineNuxtPlugin(() => { const isIframe = useIsIframe() const crispWebsiteId = useRuntimeConfig().public.crispWebsiteId - if (crispWebsiteId && !isIframe) { + const isPublicFormPage = useRoute().name === 'forms-slug' + + if (crispWebsiteId && !isIframe && !isPublicFormPage) { Crisp.configure(crispWebsiteId) window.Crisp = Crisp }