fixed bug in qrscanner component
This commit is contained in:
parent
dc2d693562
commit
d1b7fb7c87
@ -72,6 +72,9 @@ module.exports = function (ctx) {
|
||||
'QPopupEdit',
|
||||
'QSlideTransition',
|
||||
'QToggle',
|
||||
'QStepper',
|
||||
'QStep',
|
||||
'QStepperNavigation'
|
||||
],
|
||||
|
||||
directives: [
|
||||
|
||||
@ -48,6 +48,21 @@
|
||||
cacheID: null,
|
||||
}
|
||||
},
|
||||
beforeRouteUpdate(to, from, next) {
|
||||
console.log("beforeRouteUpdate");
|
||||
this.askForPermission = true;
|
||||
this.activateCamera = false;
|
||||
this.isValid = false;
|
||||
this.validating = false;
|
||||
this.loading = false;
|
||||
this.paused = false;
|
||||
this.result = null;
|
||||
this.params = null;
|
||||
this.noStreamApiSupport = false;
|
||||
this.setCacheId();
|
||||
this.updateCameraState();
|
||||
next()
|
||||
},
|
||||
created() {
|
||||
this.setCacheId();
|
||||
},
|
||||
@ -89,6 +104,8 @@
|
||||
console.log("cache access definition");
|
||||
console.log(response.data.cacheAccesDefinition);
|
||||
resolve(true);
|
||||
this.askForPermission = true;
|
||||
this.activateCamera = false;
|
||||
if (Number(response.data.cacheAccesDefinition.id) === 0) {
|
||||
this.$router.push({path: `/station/${params.cacheID}/${params.stationID}`});
|
||||
} else if (Number(response.data.cacheAccesDefinition.id) === 1) {
|
||||
@ -166,8 +183,8 @@
|
||||
this.activateCamera = bool;
|
||||
if (this.askForPermission === false) {
|
||||
this.askForPermission = true;
|
||||
this.updateCameraState();
|
||||
}
|
||||
this.updateCameraState();
|
||||
},
|
||||
|
||||
logErrors(promise) {
|
||||
@ -190,19 +207,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeRouteUpdate(to, from, next) {
|
||||
this.askForPermission = true;
|
||||
this.activateCamera = false;
|
||||
this.isValid = false;
|
||||
this.validating = false;
|
||||
this.loading = false;
|
||||
this.paused = false;
|
||||
this.result = null;
|
||||
this.params = null;
|
||||
this.noStreamApiSupport = false;
|
||||
this.setCacheId();
|
||||
next()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -37,6 +37,8 @@
|
||||
},
|
||||
beforeRouteUpdate(to, from, next) {
|
||||
console.log("beforeRouteUpdate: reset data and fetch");
|
||||
this.cameraActive = false;
|
||||
this.result = null;
|
||||
this.cacheID = "";
|
||||
this.cacheName = "";
|
||||
this.cache = {
|
||||
|
||||
@ -5,7 +5,7 @@ import routes from "./routes";
|
||||
import {axiosInstance} from "../boot/axios";
|
||||
Vue.use(VueRouter);
|
||||
|
||||
//import store from "../store/index";
|
||||
import store from "../store/index";
|
||||
|
||||
/*
|
||||
* If not building with SSR mode, you can
|
||||
@ -57,6 +57,7 @@ export default function({ store }/* { store, ssrContext } */) {
|
||||
})
|
||||
.then((response) => {
|
||||
console.log("Token valid!");
|
||||
store.commit('auth/SET_AUTHENTICATED');
|
||||
return next();
|
||||
})
|
||||
.catch((error) => {
|
||||
@ -72,6 +73,7 @@ export default function({ store }/* { store, ssrContext } */) {
|
||||
title: "Bitte erneut anmelden.",
|
||||
color: "blue", });
|
||||
localStorage.removeItem('userToken');
|
||||
store.commit('auth/SET_AUTHENTICATED');
|
||||
return next('/Login');
|
||||
} else {
|
||||
console.log("unexpected behaviour");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user