feat(notifications): alert user to achievements

This commit is contained in:
Sabe Jones
2019-06-11 13:06:00 -05:00
parent 103945f7c5
commit 81333a3074
14 changed files with 346 additions and 6 deletions

View File

@@ -96,6 +96,13 @@ module.exports = function feed (user, req = {}) {
});
if (mountIndex === -1) {
user.achievements.allYourBase = true;
if (user.addNotification) {
user.addNotification('ACHIEVEMENT_ALL_YOUR_BASE', {
achievement: 'allYourBase',
message: `${i18n.t('modalAchievement')} ${i18n.t('achievementAllYourBase')}`,
modalText: i18n.t('achievementAllYourBaseModalText'),
});
}
}
}

View File

@@ -46,6 +46,13 @@ module.exports = function hatch (user, req = {}) {
});
if (petIndex === -1) {
user.achievements.backToBasics = true;
if (user.addNotification) {
user.addNotification('ACHIEVEMENT_BACK_TO_BASICS', {
achievement: 'backToBasics',
message: `${i18n.t('modalAchievement')} ${i18n.t('achievementBackToBasics')}`,
modalText: i18n.t('achievementBackToBasicsModalText'),
});
}
}
}