1
0
Fork 0
mirror of https://github.com/em-squared/5e-drs.git synced 2025-10-30 13:14:20 +00:00

réduction de la taille des emplacements de sorts dans le grimoire personnel + options d'impressions

This commit is contained in:
Maxime Moraine 2020-05-04 12:01:58 +02:00
parent e6c38d156a
commit 44b8729230
3 changed files with 25 additions and 8 deletions

View file

@ -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) {