* sync user if Armoire gives XP * user can level up from Armoire * remove XP amount from Armoire XP notification
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user