Add error notification for deleted user (#10600)

* snackbar notification for deleted user

* check for 404

* localize text
This commit is contained in:
Isabelle Lavandero
2018-08-17 06:02:43 -04:00
committed by Matteo Pagliazzi
parent cce9b33844
commit ec444384f4
2 changed files with 14 additions and 3 deletions

View File

@@ -202,8 +202,17 @@ export default {
if (!profile._id) {
const result = await this.$store.dispatch('members:fetchMember', { memberId });
this.cachedProfileData[memberId] = result.data.data;
profile = result.data.data;
if (result.response && result.response.status === 404) {
return this.$store.dispatch('snackbars:add', {
title: 'Habitica',
text: this.$t('messageDeletedUser'),
type: 'error',
timeout: false,
});
} else {
this.cachedProfileData[memberId] = result.data.data;
profile = result.data.data;
}
}
// Open the modal only if the data is available

View File

@@ -69,5 +69,7 @@
"notificationsRequired": "Notification ids are required.",
"unallocatedStatsPoints": "You have <span class=\"notification-bold-blue\"><%= points %> unallocated Stat Points</span>",
"beginningOfConversation": "This is the beginning of your conversation with <%= userName %>. Remember to be kind, respectful, and follow the Community Guidelines!"
"beginningOfConversation": "This is the beginning of your conversation with <%= userName %>. Remember to be kind, respectful, and follow the Community Guidelines!",
"messageDeletedUser": "Sorry, this user has deleted their account."
}