[Vuejs]-Vuex state not updating

0👍

This might be happening because you have given same name to mutation and state variable: isRetailer, I don’t have any reference right now, but this might be the case for mutation not triggering, You can try once by setting your mutation by different name such as:

mutations: {
    ...
    ...
    setIsRetailer (state) {
        state.isRetailer = true
    },
    isNotRetailer (state) {
        state.isRetailer = false
    }
},

and use this in actions:

actions: {
    checkUser (context, user) {
        ...
        ...

            context.commit('authUser', user);
            context.commit('setIsRetailer');

        }

Leave a comment