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