Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
refactor: add comment when fetching children
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia committed Feb 3, 2021
1 parent fd29189 commit 38a6c83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/actions/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ export const getSharedItems = () => async (dispatch) => {
const { children, id } = item;
// get children
let newChildren = [];

// an item does not come automatically with children
// thus we need to fetch them if no children is specified
// we don't need to fetch again if they already exists (cache)
if (!children) {
// eslint-disable-next-line no-await-in-loop
newChildren = await Api.getChildren(id);
Expand Down

0 comments on commit 38a6c83

Please sign in to comment.