diff --git a/docs/.vuepress/store/modules/mySpells.js b/docs/.vuepress/store/modules/mySpells.js index b311a03..ba67cb5 100644 --- a/docs/.vuepress/store/modules/mySpells.js +++ b/docs/.vuepress/store/modules/mySpells.js @@ -33,9 +33,15 @@ export default { // Récupération des données utilisateurs depuis le navigateur if(localStorage.getItem('mySpells') && localStorage.getItem('mySpells') !== undefined) { let localStorageData = JSON.parse(localStorage.getItem('mySpells')) - state.spells = localStorageData.spells - state.spellSlots = localStorageData.spellSlots - state.notPrintedSpells = localStorageData.notPrintedSpells + if (localStorageData.spells) { + state.spells = localStorageData.spells + } + if (localStorageData.spellSlots) { + state.spellSlots = localStorageData.spellSlots + } + if (localStorageData.notPrintedSpells) { + state.notPrintedSpells = localStorageData.notPrintedSpells + } } }, setSpells: (state, payload) => { @@ -65,6 +71,9 @@ export default { setSpellSlots: (state, payload) => { state.spellSlots = payload }, + setNotPrintedSpells: (state, payload) => { + state.notPrintedSpells = payload + }, addNotPrintedSpell: (state, payload) => { let spellIndex = state.notPrintedSpells.findIndex(spell => spell.key == payload.key) if (!spellIndex >= 0) { diff --git a/docs/.vuepress/theme/components/MySpells.vue b/docs/.vuepress/theme/components/MySpells.vue index 48dfe69..c38bb02 100644 --- a/docs/.vuepress/theme/components/MySpells.vue +++ b/docs/.vuepress/theme/components/MySpells.vue @@ -40,13 +40,13 @@