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>
|
</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>
|
||||||
Loading…
x
Reference in New Issue
Block a user