mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57:22 +01:00
feat(notifications): alert user to achievements
This commit is contained in:
@@ -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'),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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'),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user