Browse Source

added if else clause in fetchContext

So that if we get an error, then we will
only delete status if it is an 404 error
master
Rakib Hasan 7 years ago
parent
commit
dfd4a42b35
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      app/assets/javascripts/components/actions/statuses.jsx

+ 6
- 2
app/assets/javascripts/components/actions/statuses.jsx View File

@ -103,8 +103,12 @@ export function fetchContext(id) {
dispatch(fetchContextSuccess(id, response.data.ancestors, response.data.descendants));
dispatch(fetchStatusCard(id));
}).catch(error => {
dispatch(deleteStatusSuccess(id));
dispatch(deleteFromTimelines(id));
if (error.response.status == 404){
dispatch(deleteStatusSuccess(id));
dispatch(deleteFromTimelines(id));
}else{
dispatch(fetchContextFail(id, error));
}
});
};
};

Loading…
Cancel
Save