Skip to content

Commit

Permalink
added cookie functionality when skipping tour
Browse files Browse the repository at this point in the history
  • Loading branch information
Tjalling-dejong committed Jan 23, 2025
1 parent ea4e9ef commit 6f64b46
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -240,7 +241,10 @@
this.localeIsLoading = false
})
this.tourCallbacks = { onSkip: this.skipTourCallback, }
this.showTour()
const skipTourCookie = getCookie("skipTour")
if (!skipTourCookie) {
this.showTour()
}
},
methods: {
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit 6f64b46

Please sign in to comment.