mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-20 20:58:51 +00:00
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:
parent
1361fea2d4
commit
577e6f005e
1 changed files with 6 additions and 1 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue