Removed update stats notification (#10339)

* Removed update stats notification

* Removed level up hook
This commit is contained in:
Keith Holliday
2018-05-07 12:45:36 -05:00
committed by GitHub
parent 8470f16f4f
commit 54a4bba228
3 changed files with 54 additions and 53 deletions

View File

@@ -20,7 +20,7 @@ module.exports = function updateStats (user, stats, req = {}, analytics) {
if (stats.exp >= experienceToNextLevel) {
user.stats.exp = stats.exp;
const initialLvl = user.stats.lvl;
// const initialLvl = user.stats.lvl;
while (stats.exp >= experienceToNextLevel) {
stats.exp -= experienceToNextLevel;
@@ -50,12 +50,13 @@ module.exports = function updateStats (user, stats, req = {}, analytics) {
}
}
const newLvl = user.stats.lvl;
if (user.addNotification) user.addNotification('LEVELED_UP', {
initialLvl,
newLvl,
});
// @TODO: Tmp disable to see if this is causing concurrency
// const newLvl = user.stats.lvl;
//
// if (user.addNotification) user.addNotification('LEVELED_UP', {
// initialLvl,
// newLvl,
// });
}
user.stats.exp = stats.exp;