Show cookie toast only once
All checks were successful
Build and deploy updated apps / Build & deploy (push) Successful in 2m15s
All checks were successful
Build and deploy updated apps / Build & deploy (push) Successful in 2m15s
This commit is contained in:
parent
aaf68fcba8
commit
0594afe6a0
@ -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>
|
||||
Loading…
x
Reference in New Issue
Block a user