mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-04 04:59:40 +00:00
client: Fix display of class bonus for other users (#10376)
Whenever one is hovering an item from another user, the bonuses of these items are shown for the own user. So for example if you're a mage and view a Royal Magus Robe of another mage, the class bonus is 6. However if you're a warrior, the class bonus displays as 0 because the attributes grid is always using the stats for the own user even if viewing equipment of a different user. I've fixed this by moving the user object to the properties in attributesGrid and passing the current user from every other Vue file that's using attributesGrid. Not sure whether this is the right approach, as I'm no expert in Vue.js but some testing with the client now shows the correct values. Signed-off-by: aszlig <aszlig@nix.build>
This commit is contained in:
parent
eaf0c62e16
commit
4f2d066d66
5 changed files with 9 additions and 3 deletions
|
|
@ -147,11 +147,13 @@
|
|||
item: {
|
||||
type: Object,
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
ATTRIBUTES: 'constants.ATTRIBUTES',
|
||||
user: 'user.data',
|
||||
flatGear: 'content.gear.flat',
|
||||
}),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ div
|
|||
div(v-else)
|
||||
h4.popover-content-title {{ itemText }}
|
||||
.popover-content-text {{ itemNotes }}
|
||||
attributesGrid(:item="item")
|
||||
attributesGrid(:user="user", :item="item")
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
span.className.textCondensed(:class="itemClass") {{ getClassName(itemClass) }}
|
||||
|
||||
attributesGrid.attributesGrid(
|
||||
:user="user",
|
||||
:item="item",
|
||||
v-if="attributesGridVisible"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@
|
|||
slot(name="additionalInfo", :item="item")
|
||||
equipmentAttributesGrid.attributesGrid(
|
||||
v-if="showAttributesGrid",
|
||||
:item="item"
|
||||
:item="item",
|
||||
:user="user"
|
||||
)
|
||||
|
||||
.purchase-amount(v-if='item.value > 0')
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
h4.gearTitle {{ getGearTitle(equippedItems[key]) }}
|
||||
attributesGrid.attributesGrid(
|
||||
:item="content.gear.flat[equippedItems[key]]",
|
||||
:user="user"
|
||||
)
|
||||
|
||||
h3(v-if="label !== 'skip'") {{ label }}
|
||||
|
|
@ -51,6 +52,7 @@
|
|||
h4.gearTitle {{ getGearTitle(costumeItems[key]) }}
|
||||
attributesGrid.attributesGrid(
|
||||
:item="content.gear.flat[costumeItems[key]]",
|
||||
:user="user"
|
||||
)
|
||||
|
||||
h3(v-if="label !== 'skip'") {{ label }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue