Show cookie toast only once
All checks were successful
Build and deploy updated apps / Build & deploy (push) Successful in 2m15s

This commit is contained in:
Dominik Milacher 2025-06-23 21:42:00 +02:00
parent aaf68fcba8
commit 0594afe6a0

View File

@ -5,19 +5,23 @@
</template>
<script setup>
const {t, tm, rt} = useVariantData()
const { t } = useVariantData()
const { add } = useToast()
const shown = useCookie('cookie-toast-shown', { maxAge: 60 * 60 * 24 * 7 })
onMounted(() => {
add({
title: t('cookies.title'),
description: t('cookies.description'),
timeout: 8000,
color: 'primary',
icon: 'i-heroicons-shield-check',
ui: {
position: "bottom-center"
}
})
if (!shown.value) {
add({
title: t('cookies.title'),
description: t('cookies.description'),
timeout: 8000,
color: 'primary',
icon: 'i-heroicons-shield-check',
ui: {
position: "bottom-center"
}
})
shown.value = true
}
})
</script>