Skip to content
Snippets Groups Projects
Commit 7c857b35 authored by Lene Wasskog's avatar Lene Wasskog
Browse files

feat: Redirect to crop category only if not selected

parent edb2b172
Branches
Tags v1.1.15
No related merge requests found
...@@ -123,7 +123,6 @@ ...@@ -123,7 +123,6 @@
methods: { methods: {
/** Get user details from local storage */ /** Get user details from local storage */
getUserFromStorage() { getUserFromStorage() {
let strUser = localStorage.getItem(CommonUtil.CONST_STORAGE_USER_DETAIL); let strUser = localStorage.getItem(CommonUtil.CONST_STORAGE_USER_DETAIL);
if (strUser && strUser != 'undefined') { if (strUser && strUser != 'undefined') {
let user = JSON.parse(strUser); let user = JSON.parse(strUser);
...@@ -135,7 +134,8 @@ ...@@ -135,7 +134,8 @@
this.userLoggedInName = this.$root.sharedState.user.firstName + " " + this.$root.sharedState.user.lastName; this.userLoggedInName = this.$root.sharedState.user.firstName + " " + this.$root.sharedState.user.lastName;
} }
/** Show the observation list instead of welcome page if user is logged in */ /** Show the observation list instead of welcome page if user is logged in */
if(this.$root.sharedState.uuid) { const cropCategorySelected = localStorage.getItem(CommonUtil.CONST_STORAGE_CROP_ID_LIST) !== null;
if(this.$root.sharedState.uuid && !cropCategorySelected) {
this.$router.push("/cropCategory"); this.$router.push("/cropCategory");
} }
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment