forked from verdnatura/hedera-web
Prevent entering basket view before checks
This commit is contained in:
parent
057bfae517
commit
a9427ddab9
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onBeforeMount, ref, inject, onMounted } from 'vue';
|
import { onBeforeMount, ref, inject } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import { useAppStore } from 'stores/app';
|
import { useAppStore } from 'stores/app';
|
||||||
|
@ -17,14 +17,12 @@ const rows = ref([]);
|
||||||
const ticket = ref({});
|
const ticket = ref({});
|
||||||
const orderId = ref(null);
|
const orderId = ref(null);
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(async () => {
|
||||||
appStore.check();
|
await appStore.check();
|
||||||
});
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
orderId.value = route.params.id || basketOrderId.value;
|
orderId.value = route.params.id || basketOrderId.value;
|
||||||
if (orderId.value) await fetchData();
|
if (orderId.value) await fetchData();
|
||||||
});
|
});
|
||||||
|
|
||||||
const getOrder = async () => {
|
const getOrder = async () => {
|
||||||
try {
|
try {
|
||||||
const [data] = await jApi.query(
|
const [data] = await jApi.query(
|
||||||
|
|
|
@ -87,7 +87,7 @@ export const useAppStore = defineStore('hedera', {
|
||||||
if (this.basketOrderId) {
|
if (this.basketOrderId) {
|
||||||
return await this.checkRedirect(checkoutContinue);
|
return await this.checkRedirect(checkoutContinue);
|
||||||
} else {
|
} else {
|
||||||
this.redirect();
|
await this.redirect();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue