diff --git a/website/client/src/store/actions/shops.js b/website/client/src/store/actions/shops.js index fea30216b8..52c2aea350 100644 --- a/website/client/src/store/actions/shops.js +++ b/website/client/src/store/actions/shops.js @@ -78,9 +78,8 @@ async function buyArmoire (store, params) { // @TODO: We might need to abstract notifications to library rather than mixin const notificationOptions = isExperience ? { - text: `+ ${item.value}`, - type: 'xp', - flavorMessage: message, + text: message, + type: 'success', } : { text: message, @@ -93,6 +92,10 @@ async function buyArmoire (store, params) { timeout: true, ...notificationOptions, }); + + if (isExperience) { + await store.dispatch('user:fetch', { forceLoad: true }); + } } } diff --git a/website/common/script/ops/buy/buyArmoire.js b/website/common/script/ops/buy/buyArmoire.js index fab02460d7..9a7f91e200 100644 --- a/website/common/script/ops/buy/buyArmoire.js +++ b/website/common/script/ops/buy/buyArmoire.js @@ -10,6 +10,7 @@ import { import randomVal, * as randomValFns from '../../libs/randomVal'; import { removeItemByPath } from '../pinnedGearUtils'; import { AbstractGoldItemOperation } from './abstractBuyOperation'; +import updateStats from '../../fns/updateStats'; // TODO this is only used on the server // move out of common? @@ -156,6 +157,7 @@ export class BuyArmoireOperation extends AbstractGoldItemOperation { // eslint-d _experienceResult (user) { const armoireExp = Math.floor(randomValFns.trueRandom() * 40 + 10); user.stats.exp += armoireExp; + updateStats(user, user.stats, this.req); return { message: this.i18n('armoireExp'),