diff --git a/src/App.vue b/src/App.vue index a28d51d..95c7519 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,7 +3,7 @@ - + diff --git a/src/store/actions.js b/src/store/actions.js index 20faa14..43660bd 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -4,6 +4,7 @@ import * as api from '@/api'; import i18n from '@/i18n'; import { + INTRO_WAS_SEEN, IS_LOADING, IS_DONE_LOADING, PUSH_REPORT, @@ -56,3 +57,7 @@ export function setLocale({ commit }, { locale }) { export function setSetting({ commit }, { setting, value }) { return commit(SET_SETTING, { setting, value }); } + +export function markIntroAsSeen({ commit }) { + return commit(INTRO_WAS_SEEN); +} diff --git a/src/store/mutations-types.js b/src/store/mutations-types.js index 78d02f0..8503b60 100644 --- a/src/store/mutations-types.js +++ b/src/store/mutations-types.js @@ -1,3 +1,4 @@ +export const INTRO_WAS_SEEN = 'INTRO_WAS_SEEN'; export const IS_LOADING = 'IS_LOADING'; export const IS_DONE_LOADING = 'IS_DONE_LOADING'; export const PUSH_REPORT = 'PUSH_REPORT'; diff --git a/src/store/mutations.js b/src/store/mutations.js index 4f7cf95..e91cdb6 100644 --- a/src/store/mutations.js +++ b/src/store/mutations.js @@ -52,6 +52,7 @@ if (storageAvailable('localStorage')) { } export const initialState = { + hasGoneThroughIntro: false, isLoading: false, reportDetails: { id: null, @@ -67,6 +68,9 @@ export const initialState = { }; export const mutations = { + [types.INTRO_WAS_SEEN](state) { + state.hasGoneThroughIntro = true; + }, [types.IS_LOADING](state) { state.isLoading = true; }, diff --git a/src/views/Map.vue b/src/views/Map.vue index 67b54d3..b08d4a6 100644 --- a/src/views/Map.vue +++ b/src/views/Map.vue @@ -52,7 +52,7 @@ export default { ReportDialog, }, created() { - if (!this.$store.state.settings.skipOnboarding) { + if (!this.$store.state.hasGoneThroughIntro) { this.$router.replace({ name: 'Onboarding' }); } }, diff --git a/src/views/Onboarding.vue b/src/views/Onboarding.vue index bf8321f..f531641 100644 --- a/src/views/Onboarding.vue +++ b/src/views/Onboarding.vue @@ -55,6 +55,7 @@ export default { this.hasGeolocationPermission = (result.state === 'granted'); }); } + this.$store.dispatch('markIntroAsSeen'); }, data() { let step = 0;