diff --git a/docs/.vuepress/store/modules/mySpells.js b/docs/.vuepress/store/modules/mySpells.js index cbd0fcc..b311a03 100644 --- a/docs/.vuepress/store/modules/mySpells.js +++ b/docs/.vuepress/store/modules/mySpells.js @@ -5,7 +5,8 @@ export default { state: { spells: [], - spellSlots: [] + spellSlots: [], + notPrintedSpells: [] }, getters: { @@ -34,6 +35,7 @@ export default { let localStorageData = JSON.parse(localStorage.getItem('mySpells')) state.spells = localStorageData.spells state.spellSlots = localStorageData.spellSlots + state.notPrintedSpells = localStorageData.notPrintedSpells } }, setSpells: (state, payload) => { @@ -63,6 +65,18 @@ export default { setSpellSlots: (state, payload) => { state.spellSlots = payload }, + addNotPrintedSpell: (state, payload) => { + let spellIndex = state.notPrintedSpells.findIndex(spell => spell.key == payload.key) + if (!spellIndex >= 0) { + state.notPrintedSpells.push(payload) + } + }, + removeNotPrintedSpell: (state, payload) => { + let spellIndex = state.notPrintedSpells.findIndex(spell => spell.key == payload.key) + if (spellIndex >= 0) { + state.notPrintedSpells.splice(spellIndex, 1) + } + } } } diff --git a/docs/.vuepress/theme/components/MySpells.vue b/docs/.vuepress/theme/components/MySpells.vue index 639490e..48dfe69 100644 --- a/docs/.vuepress/theme/components/MySpells.vue +++ b/docs/.vuepress/theme/components/MySpells.vue @@ -80,9 +80,15 @@ @@ -93,7 +99,7 @@

Sorts de niveau {{ level }}

-