mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-13 13:48:26 +00:00
Fix showAds
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user