Skip to content

Commit 83dfd07

Browse files
committed
hotfix, bump to v0.2
1 parent 3066341 commit 83dfd07

File tree

6 files changed

+35
-33
lines changed

6 files changed

+35
-33
lines changed

bun.lockb

-6.73 KB
Binary file not shown.

bun.lockb.x

43.2 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"vue-command": "^35.2.1",
1616
"vue-cookie-law": "github:elasticdotventures/vue-cookie-law",
1717
"vue-cookie-next": "^1.3.0",
18-
"vue-gtag": "^2.0.1"
18+
"vue-gtag-next": "^1.14.0"
1919
},
2020
"devDependencies": {
2121
"@vitejs/plugin-vue": "^4.5.0",

src/components/CommandLineInterface.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const commands = {
2424
<template>
2525
<div class="cli-container">
2626
<vue-command :commands="commands" :hide-buttons="true" :show-help="true" :cursor-position="0" :is-fullscreen="true">
27-
<template #title>Command Line Interface v0.1 -- type "help" for instructions</template>
27+
<template #title>Command Line Interface v0.2 -- type "help" for instructions</template>
2828
<template #prompt>
2929
<span class="prompt">
3030
<span class="prompt-user">guest</span>

src/components/CookieBanner.vue

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,26 @@
1010
</template>
1111

1212
<script lang="ts">
13-
import useCookies from '../useCookies';
14-
import { defineComponent, getCurrentInstance } from 'vue';
13+
import { defineComponent } from 'vue';
1514
import { useMainStore } from '../store';
15+
import { useState } from 'vue-gtag-next';
1616
1717
export default defineComponent({
1818
setup() {
19-
const instance = getCurrentInstance();
20-
const gtag = instance?.appContext.config.globalProperties.$gtag;
2119
const mainStore = useMainStore();
22-
23-
const { allowCookies } = useCookies(gtag);
20+
const { isEnabled } = useState();
2421
2522
const handleConsent = () => {
26-
allowCookies.value = true;
2723
mainStore.setCookieConsent('accepted');
28-
if (gtag) {
29-
gtag.optIn();
24+
if (isEnabled) {
25+
isEnabled.value = true; // Enable tracking
3026
}
3127
};
3228
3329
const handleReject = () => {
34-
allowCookies.value = false;
3530
mainStore.setCookieConsent('rejected');
36-
if (gtag) {
37-
gtag.optOut();
31+
if (isEnabled) {
32+
isEnabled.value = false; // Disable tracking
3833
}
3934
};
4035
@@ -97,4 +92,4 @@ export default defineComponent({
9792
.reject-button:hover {
9893
background-color: darkgrey;
9994
}
100-
</style>
95+
</style>

src/main.ts

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,33 @@ import { createApp } from 'vue'
44
import './style.css'
55
import App from './App.vue'
66
// https://matteo-gabriele.gitbook.io/vue-gtag/
7-
import VueGtag from "vue-gtag";
7+
import VueGtag from "vue-gtag-next";
88
import { VueCookieNext } from 'vue-cookie-next';
99
import { createPinia } from 'pinia'
1010

11-
// An application instance won't render anything until its .mount() method is called
11+
// // An application instance won't render anything until its .mount() method is called
1212
const app = createApp(App);
13-
const pinia = createPinia()
14-
15-
app
16-
.use(pinia)
17-
.use(VueCookieNext)
18-
.use(VueGtag, {
19-
config: {
20-
id: "G-XP9X9LHTDV",
21-
params: {
22-
anonymize_ip: true
23-
}
24-
},
25-
enabled: false
26-
})
27-
.provide('gtag', app.config.globalProperties.$gtag)
28-
.mount('#app')
13+
14+
app.use(createPinia());
15+
16+
app.use(VueCookieNext);
17+
18+
// app.use(VueGtag, {
19+
// config: {
20+
// id: "G-XP9X9LHTDV",
21+
// params: {
22+
// anonymize_ip: true
23+
// }
24+
// },
25+
// enabled: false
26+
// })
27+
// .provide('gtag', app.config.globalProperties.$gtag);
28+
29+
app.use(VueGtag, {
30+
property: { id: "G-XP9X9LHTDV" },
31+
isEnabled: false,
32+
});
33+
34+
app.mount('#app');
35+
2936

0 commit comments

Comments
 (0)