export default {
  state: {
    wifiInfo: {
      ssid: '',
      password: ''
    },
    isConnected: false
  },
  mutations: {
    setWifiInfo(state, wifiInfo) {
      state.wifiInfo = wifiInfo
    },
    changeConnectStatus(state, isConnected) {
      state.isConnected = isConnected
    },
    resetWifiInfo(state) {
      state.wifiInfo = {
        ssid: '',
        password: ''
      }
    }
  },
  actions: {
    setWifiInfo({ commit }, data) {
      commit('setWifiInfo', data);
    },
    resetWifiInfo({ commit }) {
      commit('resetWifiInfo');
    },
    changeConnectStatus({ commit }, data) {
      commit('changeConnectStatus', data);
    }
  }
}
