We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ad7b1de + 6104c58 commit 8a6dd62Copy full SHA for 8a6dd62
src/service/AvatarService.js
@@ -34,22 +34,18 @@ export const fetchAvatarUrl = (email) => {
34
})
35
36
return Axios.get(url, { adapter: 'fetch', fetchOptions: { priority: 'low' } })
37
- .then((resp) => resp.data)
38
- .then((avatar) => {
39
- if (avatar.isExternal) {
+ .then(res => {
+ if (res.status === 204) {
+ return undefined
40
+ }
41
+
42
+ if (res.data.isExternal) {
43
return generateUrl('/apps/mail/api/avatars/image/{email}', {
44
email,
45
- } else {
- return avatar.url
- }
46
- })
47
- .catch((err) => {
48
- if (err.response.status === 404) {
49
- return undefined
50
}
51
52
- return Promise.reject(err)
+ return res.data.url
53
54
55
0 commit comments