From 6f64b46eb7a61fefa8f47cc722d46ba04b6147ba Mon Sep 17 00:00:00 2001 From: Tjalling-dejong Date: Thu, 23 Jan 2025 11:12:40 +0100 Subject: [PATCH] added cookie functionality when skipping tour --- src/App.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index b90690d..af016fb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -140,6 +140,7 @@ import { tourConfig, generateTourSteps, tourStepCount } from '@/plugins/vue-tour' import FeedbackDialog from './components/FeedbackDialog/FeedbackDialog.vue' import AcknowledgmentsDialog from '~/components/AcknowledgmentsDialog/AcknowledgmentsDialog.vue' + import { getCookie, setCookie } from './lib/cookies' const removeRegion = locale => locale.replace(/-.+/, '') const localeIsAvailable = locale => availableLocales.includes(locale) @@ -240,7 +241,10 @@ this.localeIsLoading = false }) this.tourCallbacks = { onSkip: this.skipTourCallback, } - this.showTour() + const skipTourCookie = getCookie("skipTour") + if (!skipTourCookie) { + this.showTour() + } }, methods: { @@ -335,8 +339,8 @@ showTour () { this.$tours.introduction.start() }, - skipTourCallback(currentStep) { - console.log("Skip button pressed!") + skipTourCallback() { + setCookie("skipTour", true, 30) }, nextStep () { if (tourStepCount == 2 ) {