const state = {
  fontSize: localStorage.getItem("fontSize") || 1,
  selectedIndex: sessionStorage.getItem("selectedIndex") || "",
}
const getters = {
  fontSize: (state) => state.fontSize,
  selectedIndex: (state) => state.selectedIndex,
}
const mutations = {
  setFontSize(state, fontSize) {
    state.fontSize = fontSize
  },
  setSelectedIndex(state, selectedIndex) {
    state.selectedIndex = selectedIndex
    sessionStorage.setItem("selectedIndex", selectedIndex)
  },
  removeSelectedIndex() {
    state.selectedIndex = ""
    sessionStorage.removeItem("selectedIndex")
  },
}
const actions = {}
export default {
  state,
  getters,
  mutations,
  actions,
}
