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

@ -90,6 +90,7 @@ import { mapState } from 'vuex'
import Breadcrumb from '@theme/components/Breadcrumb'
import { displayChallenge } from '@theme/util/monsterHelpers'
import { setUrlParams, getUrlParameter } from '@theme/util/filterHelpers'
import { isResourceInLibrary } from '@theme/util'
import Monster from '@theme/components/Monster'
import MyMonstersButton from '@theme/global-components/MyMonstersButton'
import { CHALLENGES } from '../../data/monsters'
@ -268,13 +269,7 @@ export default {
displayList (list) { return list.join(', ') },
displayChallenge (challenge) { return displayChallenge(challenge) },
isMonsterInBestiary (monster) {
let isInBestiary = false
for (let m of this.$store.state.myMonsters.monsters) {
if (m.key == monster.key) {
isInBestiary = true
}
}
return isInBestiary
return isResourceInLibrary(monster, this.$store.state.myMonsters.monsters)
},
toggleMonsterInBestiary (monster) {
if (this.isMonsterInBestiary(monster)) {