1
0
Fork 0
mirror of https://github.com/em-squared/5e-drs.git synced 2025-10-31 21:44:20 +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

@ -110,6 +110,7 @@ import { saveAs } from 'file-saver'
import { CLASSES } from '../../data/classes'
import { SPELLSCHOOLS, SPELLLEVELS } from '../../data/spells'
import { getUrlParameter } from '@theme/util/filterHelpers'
import { isResourceInLibrary } from '@theme/util'
import slugify from 'slugify'
slugify.extend({"'": '-'})
@ -123,13 +124,7 @@ export default {
computed: {
isSpellInSpellBook () {
let isInSpellBook = false
for (let s of this.$store.state.mySpells.spells) {
if (s.key == this.spell.key) {
isInSpellBook = true
}
}
return isInSpellBook
return isResourceInLibrary(this.spell, this.$store.state.mySpells.spells)
},
displayToggleSpellButton () {