Force user to click at least once on a button before showing the map, otherwise NoSleep might not work
This commit is contained in:
parent
fbe8298814
commit
959cdba36c
@ -3,7 +3,7 @@
|
|||||||
<v-toolbar
|
<v-toolbar
|
||||||
app
|
app
|
||||||
>
|
>
|
||||||
<router-link :to="{ name: 'Onboarding' }" class="noLinkDecoration">
|
<router-link :to="{ name: 'Map' }" class="noLinkDecoration">
|
||||||
<v-toolbar-title v-text="title" class="ma-0"></v-toolbar-title>
|
<v-toolbar-title v-text="title" class="ma-0"></v-toolbar-title>
|
||||||
</router-link>
|
</router-link>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
|
@ -4,6 +4,7 @@ import * as api from '@/api';
|
|||||||
import i18n from '@/i18n';
|
import i18n from '@/i18n';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
INTRO_WAS_SEEN,
|
||||||
IS_LOADING,
|
IS_LOADING,
|
||||||
IS_DONE_LOADING,
|
IS_DONE_LOADING,
|
||||||
PUSH_REPORT,
|
PUSH_REPORT,
|
||||||
@ -56,3 +57,7 @@ export function setLocale({ commit }, { locale }) {
|
|||||||
export function setSetting({ commit }, { setting, value }) {
|
export function setSetting({ commit }, { setting, value }) {
|
||||||
return commit(SET_SETTING, { setting, value });
|
return commit(SET_SETTING, { setting, value });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function markIntroAsSeen({ commit }) {
|
||||||
|
return commit(INTRO_WAS_SEEN);
|
||||||
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
export const INTRO_WAS_SEEN = 'INTRO_WAS_SEEN';
|
||||||
export const IS_LOADING = 'IS_LOADING';
|
export const IS_LOADING = 'IS_LOADING';
|
||||||
export const IS_DONE_LOADING = 'IS_DONE_LOADING';
|
export const IS_DONE_LOADING = 'IS_DONE_LOADING';
|
||||||
export const PUSH_REPORT = 'PUSH_REPORT';
|
export const PUSH_REPORT = 'PUSH_REPORT';
|
||||||
|
@ -52,6 +52,7 @@ if (storageAvailable('localStorage')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const initialState = {
|
export const initialState = {
|
||||||
|
hasGoneThroughIntro: false,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
reportDetails: {
|
reportDetails: {
|
||||||
id: null,
|
id: null,
|
||||||
@ -67,6 +68,9 @@ export const initialState = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const mutations = {
|
export const mutations = {
|
||||||
|
[types.INTRO_WAS_SEEN](state) {
|
||||||
|
state.hasGoneThroughIntro = true;
|
||||||
|
},
|
||||||
[types.IS_LOADING](state) {
|
[types.IS_LOADING](state) {
|
||||||
state.isLoading = true;
|
state.isLoading = true;
|
||||||
},
|
},
|
||||||
|
@ -52,7 +52,7 @@ export default {
|
|||||||
ReportDialog,
|
ReportDialog,
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (!this.$store.state.settings.skipOnboarding) {
|
if (!this.$store.state.hasGoneThroughIntro) {
|
||||||
this.$router.replace({ name: 'Onboarding' });
|
this.$router.replace({ name: 'Onboarding' });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -55,6 +55,7 @@ export default {
|
|||||||
this.hasGeolocationPermission = (result.state === 'granted');
|
this.hasGeolocationPermission = (result.state === 'granted');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
this.$store.dispatch('markIntroAsSeen');
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
let step = 0;
|
let step = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user