diff --git a/src/components/LoginSystem.vue b/src/components/LoginSystem.vue index 246a695e7ae36779c3837d68a0c6062a4629dfed..fdfbf59d7acf36c014af679cf73ef7b9c697873e 100644 --- a/src/components/LoginSystem.vue +++ b/src/components/LoginSystem.vue @@ -123,7 +123,6 @@ methods: { /** Get user details from local storage */ getUserFromStorage() { - let strUser = localStorage.getItem(CommonUtil.CONST_STORAGE_USER_DETAIL); if (strUser && strUser != 'undefined') { let user = JSON.parse(strUser); @@ -135,7 +134,8 @@ 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 */ - 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"); } },