Fix showAds

This commit is contained in:
Eric Fennis
2026-01-29 13:35:57 +01:00
parent cc8ccddc6d
commit ded620ad88
@@ -9,7 +9,6 @@ import { onMounted, ref, watchEffect } from 'vue';
const { theme } = useData();
const showAd = useSessionStorage('show-carbon-ads', true);
const carbonLoaded = ref(true);
defineProps<{
drawerOpen: boolean;
@@ -18,27 +17,21 @@ defineProps<{
onMounted(() => {
setTimeout(() => {
if (window?._carbonads == null) {
carbonLoaded.value = false;
showAd.value = false;
}
}, 5000);
});
function handleHideAd() {
console.log('HIDE AD');
showAd.value = false;
}
watchEffect(() => {
console.log(showAd.value, typeof showAd.value);
});
</script>
<template>
<div
:class="{
'drawer-open': drawerOpen,
'hide-ad': !(showAd && carbonLoaded),
'hide-ad': !showAd,
}"
class="floating-ad"
v-if="theme.carbonAds"