Hide crisp chat on form public pages

This commit is contained in:
Julien Nahum 2024-01-16 18:46:05 +01:00
parent e1e3fdee9c
commit 184096a348
1 changed files with 7 additions and 7 deletions

View File

@ -68,12 +68,6 @@ const submitted = ref(false)
const openCompleteForm = ref(null) const openCompleteForm = ref(null)
crisp.hideChat()
onBeforeRouteLeave((to, from) => {
crisp.showChat()
disableDarkMode()
})
const passwordEntered = function (password) { const passwordEntered = function (password) {
const cookie = useCookie('password-' + slug, { const cookie = useCookie('password-' + slug, {
maxAge: 60 * 60 * 7, maxAge: 60 * 60 * 7,
@ -125,14 +119,20 @@ const loadForm = async (setup=false) => {
if (!isIframe) focusOnFirstFormElement() if (!isIframe) focusOnFirstFormElement()
} }
await loadForm(true)
onMounted(() => { onMounted(() => {
crisp.hideChat()
if (form.value) { if (form.value) {
handleDarkMode(form.value?.dark_mode) handleDarkMode(form.value?.dark_mode)
handleTransparentMode(form.value?.transparent_background) handleTransparentMode(form.value?.transparent_background)
} }
}) })
await loadForm(true) onBeforeRouteLeave((to, from) => {
crisp.showChat()
disableDarkMode()
})
useOpnSeoMeta({ useOpnSeoMeta({
title: () => { title: () => {