mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Chat avatar fixes (#9103)
* Ensured rejection doesn't hurt performance * Added debounce and scroll removal * Added debounce for keydown * Fixed linting
This commit is contained in:
committed by
Sabe Jones
parent
dc3a02bc2e
commit
7671347d3a
@@ -138,12 +138,21 @@ export default {
|
||||
// @TODO split up this file, it's too big
|
||||
// Set up Error interceptors
|
||||
axios.interceptors.response.use((response) => {
|
||||
if (this.user) {
|
||||
if (this.user && response.data && response.data.notifications) {
|
||||
this.$set(this.user, 'notifications', response.data.notifications);
|
||||
}
|
||||
return response;
|
||||
}, (error) => {
|
||||
if (error.response.status >= 400) {
|
||||
// Don't show errors from getting user details. These users have delete their account,
|
||||
// but their chat message still exists.
|
||||
let configExists = Boolean(error.response) && Boolean(error.response.config);
|
||||
if (configExists && error.response.config.method === 'get' && error.response.config.url.indexOf('/api/v3/members/') !== -1) {
|
||||
// @TODO: We resolve the promise because we need our caching to cache this user as tried
|
||||
// Chat paging should help this, but maybe we can also find another solution..
|
||||
return Promise.resolve(error);
|
||||
}
|
||||
|
||||
this.$store.state.notificationStore.push({
|
||||
title: 'Habitica',
|
||||
text: error.response.data.message,
|
||||
|
||||
Reference in New Issue
Block a user