From 4f2d066d6697703470107b1ca3fe87681c8753c3 Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 25 May 2018 12:38:02 +0200 Subject: [PATCH] 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 --- .../client/components/inventory/equipment/attributesGrid.vue | 4 +++- .../components/inventory/equipment/attributesPopover.vue | 2 +- .../client/components/inventory/equipment/equipGearModal.vue | 1 + website/client/components/shops/buyModal.vue | 3 ++- website/client/components/userMenu/profileStats.vue | 2 ++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/website/client/components/inventory/equipment/attributesGrid.vue b/website/client/components/inventory/equipment/attributesGrid.vue index 19e0a946b8..9b1b17af0d 100644 --- a/website/client/components/inventory/equipment/attributesGrid.vue +++ b/website/client/components/inventory/equipment/attributesGrid.vue @@ -147,11 +147,13 @@ item: { type: Object, }, + user: { + type: Object, + }, }, computed: { ...mapState({ ATTRIBUTES: 'constants.ATTRIBUTES', - user: 'user.data', flatGear: 'content.gear.flat', }), }, diff --git a/website/client/components/inventory/equipment/attributesPopover.vue b/website/client/components/inventory/equipment/attributesPopover.vue index 731d649f34..3b51f1310c 100644 --- a/website/client/components/inventory/equipment/attributesPopover.vue +++ b/website/client/components/inventory/equipment/attributesPopover.vue @@ -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")