Speed up/optimize loading of statuses, context and cards by not re-fetching what is already loaded
This commit is contained in:
parent
8132cf8153
commit
0cbf3a146f
2 changed files with 11 additions and 2 deletions
|
@ -6,6 +6,10 @@ export const STATUS_CARD_FETCH_FAIL = 'STATUS_CARD_FETCH_FAIL';
|
|||
|
||||
export function fetchStatusCard(id) {
|
||||
return (dispatch, getState) => {
|
||||
if (getState().getIn(['cards', id], null) !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch(fetchStatusCardRequest(id));
|
||||
|
||||
api(getState).get(`/api/v1/statuses/${id}/card`).then(response => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue