diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-01-23 21:09:27 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-01-23 21:09:27 +0100 |
commit | f392030ab82a70086f93bb02c3faab53c3fbd28e (patch) | |
tree | b2dc190e9f11a2bb9ab0af55c0b7380832bbfbf3 /app/assets/javascripts/components/actions | |
parent | f2e08ff56855a2b14567f6218900823664a0ee2c (diff) |
Add /api/v1/notifications/clear, non-existing link cards for statuses will
now return empty hash instead of throwing a 404 error. When following, merge into timeline will filter statuses
Diffstat (limited to 'app/assets/javascripts/components/actions')
-rw-r--r-- | app/assets/javascripts/components/actions/cards.jsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/assets/javascripts/components/actions/cards.jsx b/app/assets/javascripts/components/actions/cards.jsx index ee421d5d7..714e80525 100644 --- a/app/assets/javascripts/components/actions/cards.jsx +++ b/app/assets/javascripts/components/actions/cards.jsx @@ -9,13 +9,12 @@ export function fetchStatusCard(id) { dispatch(fetchStatusCardRequest(id)); api(getState).get(`/api/v1/statuses/${id}/card`).then(response => { - dispatch(fetchStatusCardSuccess(id, response.data)); - }).catch(error => { - if (error.response.status === 404) { - // This is fine + if (response.data.length === 0) { return; } + dispatch(fetchStatusCardSuccess(id, response.data)); + }).catch(error => { dispatch(fetchStatusCardFail(id, error)); }); }; |