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,10 +5,12 @@
|
|||||||
</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(() => {
|
||||||
|
if (!shown.value) {
|
||||||
add({
|
add({
|
||||||
title: t('cookies.title'),
|
title: t('cookies.title'),
|
||||||
description: t('cookies.description'),
|
description: t('cookies.description'),
|
||||||
@ -19,5 +21,7 @@ onMounted(() => {
|
|||||||
position: "bottom-center"
|
position: "bottom-center"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
shown.value = true
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
Loading…
x
Reference in New Issue
Block a user