diff options
Diffstat (limited to 'src/sagas/objects.js')
| -rw-r--r-- | src/sagas/objects.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sagas/objects.js b/src/sagas/objects.js index 5fac6c3e..5c9f00c2 100644 --- a/src/sagas/objects.js +++ b/src/sagas/objects.js @@ -39,11 +39,12 @@ export const OBJECT_SELECTORS = { function* fetchAndStoreObject(objectType, id, apiCall) { const objectStore = yield select(OBJECT_SELECTORS[objectType]); - if (!objectStore[id]) { - const object = yield apiCall; + let object = objectStore[id]; + if (!object) { + object = yield apiCall; yield put(addToStore(objectType, object)); } - return objectStore[id]; + return object; } function* fetchAndStoreObjects(objectType, apiCall) { |
