
const getDefaultState = () => {
  return {
    curPath: null,
    navBarFixed: false,
    showLoginDialog: null
  }
}

const state = getDefaultState()

const mutations = {
  RESET_STATE: (state) => {
    Object.assign(state, getDefaultState())
  },
  SET_NAV_BAR: (state, path) => {
    state.curPath = path
  },
  SET_NAVBAR_FIXED: (state, isFixed) => {
    state.navBarFixed = isFixed
  },
  OPEN_LOGIN_DIALOG: (state, showLoginDialog) => {
    state.showLoginDialog = showLoginDialog
  }
}

export default {
  namespaced: true,
  state,
  mutations,
}
