mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Add error notification for deleted user (#10600)
* snackbar notification for deleted user * check for 404 * localize text
This commit is contained in:
committed by
Matteo Pagliazzi
parent
cce9b33844
commit
ec444384f4
@@ -202,9 +202,18 @@ export default {
|
|||||||
|
|
||||||
if (!profile._id) {
|
if (!profile._id) {
|
||||||
const result = await this.$store.dispatch('members:fetchMember', { memberId });
|
const result = await this.$store.dispatch('members:fetchMember', { memberId });
|
||||||
|
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;
|
this.cachedProfileData[memberId] = result.data.data;
|
||||||
profile = result.data.data;
|
profile = result.data.data;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Open the modal only if the data is available
|
// Open the modal only if the data is available
|
||||||
if (profile && !profile.rejected) {
|
if (profile && !profile.rejected) {
|
||||||
|
|||||||
@@ -69,5 +69,7 @@
|
|||||||
"notificationsRequired": "Notification ids are required.",
|
"notificationsRequired": "Notification ids are required.",
|
||||||
"unallocatedStatsPoints": "You have <span class=\"notification-bold-blue\"><%= points %> unallocated Stat Points</span>",
|
"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."
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user