I am desperately needing some help with vuejs vuex store. it is working absolutely fine in chrome but in safari store property is not being picked up. basically I have stored a user object in Vuex store as follows: - here is the image of my code
here is the image of within component where I am trying to access the property from store
here is the image of when axios call is made and within response I am triggering the mutation
state:{
user:{},
student:{}
},
mutations:{
setUser(state,payload) {
state.user = payload;
},
setLoggedIn (state,payload) {
state.isLoggedIn = payload;
},
setStudent(state,payload){
state.student = payload;
}
},
getters:{
isStudent: state => {
if(state.user.user_type === 'student') {
return true;
}
}
}
I am calling the mutation from inside the login component whilst executing axios call request and setting the user and student through appropriate commit from the component. However, when I am trying to access the user property inside the component, it works fine for Chrome but it is not working for Safari. Here is how I am calling for state user property inside the component: -
computed:{
computedStatus(){
return this.$store.state.isLoggedIn;
},
computedUserType(){
return this.$store.state.user.user_type;
},
isUserStudent(){
return this.$store.getters.isStudent;
}
}
The property isUserStudent is used inside the component and is a dependency to further functionalities. This property is assessed correctly and as expected inside Chrome/Firefox, but in safari it is not being assessed. I am really puzzled what's going on here and hope that someone can support please