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

modification de l'identification des resources plus robuste

This commit is contained in:
Maxime Moraine 2020-05-24 13:32:31 +02:00
parent 0494298159
commit 96d028dfa6
14 changed files with 130 additions and 94 deletions

View file

@ -117,6 +117,7 @@
import { mapState } from 'vuex'
import Breadcrumb from '@theme/components/Breadcrumb'
import { setUrlParams, getUrlParameter } from '@theme/util/filterHelpers'
import { isResourceInLibrary } from '@theme/util'
import Spell from '@theme/components/Spell'
import MySpellsButton from '@theme/global-components/MySpellsButton'
@ -281,13 +282,7 @@ export default {
methods: {
isSpellInSpellBook (spell) {
let isInSpellBook = false
for (let s of this.$store.state.mySpells.spells) {
if (s.key == spell.key) {
isInSpellBook = true
}
}
return isInSpellBook
return isResourceInLibrary(spell, this.$store.state.mySpells.spells)
},
toggleSpellInSpellBook (spell) {
if (this.isSpellInSpellBook(spell)) {