Fixing the equipment popover message when equipment is from a different class - Fixes #11988 (#11993)

* Updating the equipment attributes popover to display the correct message when the equipment doesn't match the user's class

* Rewriting 'is wrong class' and abstracting logic into computed property of shop item

* Moving isWrongClass computed function from shopItem to popoverAttribute component

* Reverting accidental whitespace change

* Adding newline to end of profile.vue to get client to compile

* Reverting profile.vue back to develop branch

Co-authored-by: Laurel Thomson <laurel.beth.thomson@gmai.com>
This commit is contained in:
Laurel Thomson 2020-04-20 08:23:40 -07:00 committed by GitHub
parent 1361fea2d4
commit 577e6f005e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@
{{ `${$t('lockedItem')}` }}
</h4>
<div
v-if="item.specialClass"
v-if="isWrongClass"
class="popover-content-text"
>
{{ `${$t('classLockedItem')}` }}
@ -71,6 +71,11 @@ export default {
}
return this.item.notes;
},
isWrongClass () {
const wrongKlass = this.item.klass && !['special', 'armoire', this.user.stats.class].includes(this.item.klass);
const wrongSpecialClass = this.item.klass === 'special' && this.item.specialClass && this.item.specialClass !== this.user.stats.class;
return wrongKlass || wrongSpecialClass;
},
},
};
</script>