Skip to content

Commit 43eebfa

Browse files
committed
docs: fix carbon ads refresh
1 parent 5388661 commit 43eebfa

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

docs/.vuepress/layouts/components/CarbonAds.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { isNullish } from '@sapphire/utilities'
77
import { onMounted, ref, watch } from 'vue'
88
import { useRoute } from 'vue-router'
9+
import Demo from '../../components/Demo/Demo.vue';
910
1011
const SCRIPT_ID = '_carbonads_js'
1112
const ACCOUNT_ID = 'CE7IC27U'
@@ -16,18 +17,18 @@ const route = useRoute()
1617
const carbonAdsElementRef = ref<HTMLDivElement>()
1718
1819
async function loadCarbonAds() {
19-
console.log("loadCarbonAds")
2020
const s = document.createElement('script')
2121
s.id = SCRIPT_ID
2222
s.src = `//cdn.carbonads.com/carbon.js?serve=${ACCOUNT_ID}&placement=${PLACEMENT}`
2323
carbonAdsElementRef?.value?.appendChild(s)
2424
}
2525
26+
let hash = '';
2627
onMounted(() => {
28+
hash = window.location.hash
2729
loadCarbonAds()
2830
})
2931
30-
let hash = window.location.hash
3132
watch(route, (to, from) => {
3233
if (!isNullish(document.querySelector('#carbonads'))) {
3334
if (window.location.hash == hash) {

0 commit comments

Comments
 (0)